Implement new relay handler, rough out relay list/detail

This commit is contained in:
Jon Staab
2026-02-26 15:30:18 -08:00
parent 93e9a714cf
commit 62042b526d
11 changed files with 251 additions and 15 deletions
+24 -1
View File
@@ -1,14 +1,37 @@
import { useParams, A } from "@solidjs/router"
import { createResource, Show } from "solid-js"
import { getTenantRelay } from "../../lib/api"
export default function RelayDetail() {
const params = useParams()
const [relay] = createResource(() => params.id, getTenantRelay)
return (
<div class="max-w-4xl mx-auto px-4 py-8">
<div class="flex items-center gap-2 mb-6">
<A href="/relays" class="text-gray-500 hover:text-gray-700"> Relays</A>
</div>
<h1 class="text-2xl font-bold text-gray-900 mb-4">Relay {params.id}</h1>
<Show when={relay.loading}>
<p class="text-gray-500 mb-4">Loading relay...</p>
</Show>
<Show when={relay.error && !relay.loading}>
<p class="text-red-600 mb-4">Failed to load relay.</p>
</Show>
<Show when={relay()}>
{(loadedRelay) => (
<div class="mb-6">
<h1 class="text-2xl font-bold text-gray-900">{loadedRelay().name}</h1>
<p class="mt-1 text-sm text-gray-500">https://{loadedRelay().subdomain}.spaces.coracle.social</p>
<Show when={loadedRelay().description.trim()}>
<p class="mt-3 text-gray-700">{loadedRelay().description}</p>
</Show>
</div>
)}
</Show>
<div class="flex gap-3">
<A
href={`/relays/${params.id}/edit`}