feat: add rendering for library shelves (#359)

Co-authored-by: Aditya Chaudhary <30+useradityaa@noreply.coracle.social>
This commit is contained in:
Aditya Chaudhary 2026-08-13 16:53:38 +00:00 committed by hodlbod
parent fc768b6393
commit f411973409
2 changed files with 19 additions and 1 deletions

View file

@ -1,11 +1,12 @@
<script lang="ts">
import type {ComponentProps} from "svelte"
import {EVENT_TIME, ZAP_GOAL, THREAD, CLASSIFIED, POLL} from "@welshman/util"
import {EVENT_TIME, ZAP_GOAL, THREAD, CLASSIFIED, POLL, PINBOARD} from "@welshman/util"
import NoteContentMinimalEventTime from "@app/components/NoteContentMinimalEventTime.svelte"
import NoteContentMinimalThread from "@app/components/NoteContentMinimalThread.svelte"
import NoteContentMinimalClassified from "@app/components/NoteContentMinimalClassified.svelte"
import NoteContentMinimalGoal from "@app/components/NoteContentMinimalGoal.svelte"
import NoteContentMinimalPoll from "@app/components/NoteContentMinimalPoll.svelte"
import NoteContentMinimalBoard from "@app/components/NoteContentMinimalBoard.svelte"
import ContentMinimal from "@app/components/ContentMinimal.svelte"
const props: ComponentProps<typeof ContentMinimal> = $props()
@ -22,6 +23,8 @@
<NoteContentMinimalGoal {...props} />
{:else if props.event.kind === POLL}
<NoteContentMinimalPoll {...props} />
{:else if props.event.kind === PINBOARD}
<NoteContentMinimalBoard {...props} />
{:else}
<ContentMinimal {...props} />
{/if}

View file

@ -0,0 +1,15 @@
<script lang="ts">
import type {ComponentProps} from "svelte"
import {Pinboard} from "@welshman/domain"
import ContentMinimal from "@app/components/ContentMinimal.svelte"
import {reader} from "@app/core"
const props: ComponentProps<typeof ContentMinimal> = $props()
const board = reader(Pinboard)(props.event)
</script>
<span class="text-sm">{board?.title() || "Untitled shelf"}</span>
{#if board?.description()}
<span class="truncate min-w-0 block opacity-70">{board.description()}</span>
{/if}