2026-06-17 16:08:58 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
|
|
|
|
import RoomName from "@app/components/RoomName.svelte"
|
|
|
|
|
import ThreadBoardItem from "@app/components/ThreadBoardItem.svelte"
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
url: string
|
|
|
|
|
h: string
|
|
|
|
|
threads: TrustedEvent[]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const {url, h, threads}: Props = $props()
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
<section class="card card-flat overflow-hidden pb-4 p-0">
|
|
|
|
|
<header class="flex gap-2 justify-between bg-surface px-4 py-2.5">
|
|
|
|
|
<h2 class="text-sm font-bold">
|
2026-06-17 16:08:58 +00:00
|
|
|
{#if h}
|
|
|
|
|
#<RoomName {url} {h} />
|
|
|
|
|
{:else}
|
|
|
|
|
General
|
|
|
|
|
{/if}
|
|
|
|
|
</h2>
|
2026-06-24 20:56:53 +00:00
|
|
|
<span class="text-xs text-muted">
|
2026-06-17 16:08:58 +00:00
|
|
|
{threads.length}
|
|
|
|
|
{threads.length === 1 ? "topic" : "topics"}
|
|
|
|
|
</span>
|
|
|
|
|
</header>
|
2026-06-24 18:19:13 +00:00
|
|
|
<table class="w-full border-collapse">
|
|
|
|
|
<thead
|
2026-06-24 20:56:53 +00:00
|
|
|
class="hidden text-xs font-bold uppercase tracking-wide text-muted sm:table-header-group">
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="px-4 py-2 text-left">Topic</th>
|
|
|
|
|
<th class="w-32 px-4 py-2 text-left">Author</th>
|
|
|
|
|
<th class="w-20 px-4 py-2 text-center">Replies</th>
|
|
|
|
|
<th class="w-32 px-4 py-2 text-right">Last post</th>
|
2026-06-24 18:19:13 +00:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{#each threads as event (event.id)}
|
|
|
|
|
<ThreadBoardItem {url} {event} />
|
|
|
|
|
{/each}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2026-06-17 16:08:58 +00:00
|
|
|
</section>
|