flotilla/src/app/components/ChatMessageEmojiButton.svelte
2026-09-25 13:47:38 -07:00

27 lines
769 B
Svelte

<script lang="ts">
import type {TrustedEvent} from "@welshman/util"
import SmileCircle from "@assets/icons/smile-circle.svg?dataurl"
import Icon from "@lib/components/Icon.svelte"
import EmojiButton from "@lib/components/EmojiButton.svelte"
import {reactions, wraps} from "@app/core"
type Props = {
event: TrustedEvent
pubkeys: string[]
}
const {event, pubkeys}: Props = $props()
const onEmoji = async (emoji: string) => {
const reaction = await $reactions.react(event, emoji)
return $wraps.publish({event: reaction.event, recipients: pubkeys, pow: 16})
}
</script>
<EmojiButton
aria-label="Add a reaction"
{onEmoji}
class="button button-neutral button-xs join-item">
<Icon icon={SmileCircle} size={4} />
</EmojiButton>