flotilla/src/app/components/PinboardItem.svelte
2026-08-14 16:06:17 -07:00

38 lines
1.2 KiB
Svelte

<script lang="ts">
import cx from "classnames"
import type {PinboardReader} from "@welshman/domain"
import Button from "@lib/components/Button.svelte"
import MenuButton from "@lib/components/MenuButton.svelte"
import BoardMenu from "@app/components/BoardMenu.svelte"
type Props = {
url: string
board: PinboardReader
selected: boolean
onclick: () => void
}
const {url, board, selected, onclick}: Props = $props()
</script>
<div class="relative w-56 shrink-0">
<Button
{onclick}
aria-pressed={selected}
class={cx("card card-sm card-interactive flex h-full w-full flex-col items-start gap-1 pr-10", {
"card-primary": selected,
})}>
<strong class="truncate w-full text-left">{board.title() || "Untitled shelf"}</strong>
{#if board.description()}
<span class="line-clamp-2 text-left text-sm opacity-70">{board.description()}</span>
{/if}
</Button>
<div class="absolute right-2 top-2 z-feature">
<MenuButton
class="button button-neutral button-sm button-square"
aria-label="More options"
iconSize={4}
component={BoardMenu}
componentProps={{url, board}} />
</div>
</div>