2026-07-08 17:29:56 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import {onMount} from "svelte"
|
2026-07-28 16:16:26 +00:00
|
|
|
import type {PinboardReader} from "@welshman/domain"
|
2026-07-08 17:29:56 +00:00
|
|
|
import ShareCircle from "@assets/icons/share-circle.svg?dataurl"
|
|
|
|
|
import Code2 from "@assets/icons/code-2.svg?dataurl"
|
|
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Button from "@lib/components/Button.svelte"
|
|
|
|
|
import EventInfo from "@app/components/EventInfo.svelte"
|
2026-08-11 21:54:05 +00:00
|
|
|
import {shareEvent} from "@app/share"
|
2026-07-08 17:29:56 +00:00
|
|
|
import {pushModal} from "@app/modal"
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
url: string
|
2026-07-28 16:16:26 +00:00
|
|
|
board: PinboardReader
|
2026-07-08 17:29:56 +00:00
|
|
|
onClick: () => void
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const {url, board, onClick}: Props = $props()
|
|
|
|
|
|
|
|
|
|
const showInfo = () => pushModal(EventInfo, {url, event: board.event})
|
|
|
|
|
|
2026-08-11 21:54:05 +00:00
|
|
|
const share = () => shareEvent(url, "Shelf", board.event)
|
2026-07-08 17:29:56 +00:00
|
|
|
|
|
|
|
|
let ul: Element
|
|
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
|
ul.addEventListener("click", onClick)
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<ul class="menu whitespace-nowrap rounded-2xl bg-surface p-2" bind:this={ul}>
|
|
|
|
|
<li>
|
|
|
|
|
<Button onclick={showInfo}>
|
|
|
|
|
<Icon icon={Code2} />
|
|
|
|
|
Shelf details
|
|
|
|
|
</Button>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<Button onclick={share}>
|
|
|
|
|
<Icon icon={ShareCircle} />
|
|
|
|
|
Share to chat
|
|
|
|
|
</Button>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|