2025-02-06 18:00:25 +00:00
|
|
|
<script lang="ts">
|
2025-03-18 22:36:52 +00:00
|
|
|
import type {Snippet} from "svelte"
|
2026-08-29 17:20:39 +00:00
|
|
|
import type {Maybe} from "@welshman/lib"
|
2025-02-06 18:00:25 +00:00
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
2025-09-10 22:26:39 +00:00
|
|
|
import MenuDots from "@assets/icons/menu-dots.svg?dataurl"
|
2025-02-06 18:00:25 +00:00
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Tippy from "@lib/components/Tippy.svelte"
|
2026-08-29 17:20:39 +00:00
|
|
|
import type {TippyController} from "@lib/components/Tippy.svelte"
|
2025-02-06 18:00:25 +00:00
|
|
|
import Button from "@lib/components/Button.svelte"
|
2025-02-06 18:14:29 +00:00
|
|
|
import EventMenu from "@app/components/EventMenu.svelte"
|
2026-08-18 21:18:10 +00:00
|
|
|
import EventReactButtons from "@app/components/EventReactButtons.svelte"
|
2025-02-06 18:00:25 +00:00
|
|
|
|
2025-03-18 22:36:52 +00:00
|
|
|
type Props = {
|
2025-02-06 18:00:25 +00:00
|
|
|
url: string
|
2025-02-06 18:14:29 +00:00
|
|
|
noun: string
|
2025-02-06 18:00:25 +00:00
|
|
|
event: TrustedEvent
|
2025-07-15 22:56:55 +00:00
|
|
|
hideZap?: boolean
|
2025-03-18 22:36:52 +00:00
|
|
|
customActions?: Snippet
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-15 22:56:55 +00:00
|
|
|
const {url, noun, event, hideZap, customActions}: Props = $props()
|
2025-02-06 18:00:25 +00:00
|
|
|
|
2026-08-29 17:20:39 +00:00
|
|
|
const showPopover = () => tippy?.show()
|
|
|
|
|
|
|
|
|
|
const hidePopover = () => tippy?.hide()
|
2025-02-06 18:00:25 +00:00
|
|
|
|
2026-08-29 17:20:39 +00:00
|
|
|
let tippy: Maybe<TippyController> = $state()
|
2025-02-06 18:00:25 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-08-18 21:18:10 +00:00
|
|
|
<!-- The compact segmented control a card footer gets. EventActionBar is the full-width
|
|
|
|
|
version a detail page gets. -->
|
2026-06-24 20:56:53 +00:00
|
|
|
<div class="items-center join">
|
2026-08-18 21:18:10 +00:00
|
|
|
<EventReactButtons {url} {event} {hideZap} class="button button-neutral button-xs join-item" />
|
2026-07-02 18:36:05 +00:00
|
|
|
<Button onclick={showPopover} class="flex join-item button button-neutral button-xs">
|
|
|
|
|
<Tippy
|
2026-08-29 17:20:39 +00:00
|
|
|
bind:controller={tippy}
|
2026-07-02 18:36:05 +00:00
|
|
|
component={EventMenu}
|
|
|
|
|
props={{url, noun, event, customActions, onClick: hidePopover}}
|
|
|
|
|
params={{trigger: "manual", interactive: true}}>
|
2025-09-10 22:26:39 +00:00
|
|
|
<Icon icon={MenuDots} size={4} />
|
2026-07-02 18:36:05 +00:00
|
|
|
</Tippy>
|
|
|
|
|
</Button>
|
2026-04-17 15:22:40 +00:00
|
|
|
</div>
|