flotilla/src/app/components/ChatMessageMenu.svelte

38 lines
1.2 KiB
Svelte
Raw Normal View History

2024-10-15 21:00:15 +00:00
<script lang="ts">
2024-10-15 22:52:30 +00:00
import Icon from "@lib/components/Icon.svelte"
import Button from "@lib/components/Button.svelte"
2024-10-15 21:00:15 +00:00
import ChatMessageEmojiButton from "@app/components/ChatMessageEmojiButton.svelte"
2024-10-15 22:52:30 +00:00
import EventInfo from "@app/components/EventInfo.svelte"
2026-06-08 21:14:40 +00:00
import {pushModal} from "@app/modal"
2026-03-10 22:13:33 +00:00
import Pen from "@assets/icons/pen.svg?dataurl"
2025-09-10 22:26:39 +00:00
import Reply from "@assets/icons/reply-2.svg?dataurl"
import Code2 from "@assets/icons/code-2.svg?dataurl"
2024-10-15 21:00:15 +00:00
2026-03-10 22:13:33 +00:00
const {event, pubkeys, popover, replyTo, edit} = $props()
const reply = () => replyTo(event)
2026-03-10 22:13:33 +00:00
const onEdit = () => edit?.()
2024-10-15 21:00:15 +00:00
const showInfo = () => {
popover.hide()
pushModal(EventInfo, {event})
}
</script>
<div class="join text-xs">
2024-10-15 21:00:15 +00:00
<ChatMessageEmojiButton {event} {pubkeys} />
{#if replyTo}
<Button class="button button-neutral button-xs join-item" onclick={reply}>
2025-09-10 22:26:39 +00:00
<Icon size={4} icon={Reply} />
</Button>
{/if}
2026-03-10 22:13:33 +00:00
{#if edit}
<Button class="button button-neutral button-xs join-item" onclick={onEdit}>
2026-03-10 22:13:33 +00:00
<Icon size={4} icon={Pen} />
</Button>
{/if}
<Button class="button button-neutral button-xs join-item" onclick={showInfo}>
2025-09-10 22:26:39 +00:00
<Icon size={4} icon={Code2} />
2024-10-15 21:00:15 +00:00
</Button>
</div>