2024-10-08 18:39:16 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type {NativeEmoji} from "emoji-picker-element/shared"
|
|
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
2025-09-10 22:26:39 +00:00
|
|
|
import SmileCircle from "@assets/icons/smile-circle.svg?dataurl"
|
2024-10-24 22:48:45 +00:00
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
2024-10-23 23:16:28 +00:00
|
|
|
import EmojiButton from "@lib/components/EmojiButton.svelte"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {reactions, wraps} from "@app/core"
|
2024-10-08 18:39:16 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
type Props = {
|
2025-02-04 00:37:14 +00:00
|
|
|
event: TrustedEvent
|
|
|
|
|
pubkeys: string[]
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-04 01:21:46 +00:00
|
|
|
const {event, pubkeys}: Props = $props()
|
2024-10-08 18:39:16 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const onEmoji = async (emoji: NativeEmoji) => {
|
|
|
|
|
const reaction = await $reactions.react(event, emoji.unicode)
|
|
|
|
|
|
|
|
|
|
return $wraps.publish({event: reaction.event, recipients: pubkeys, pow: 16})
|
|
|
|
|
}
|
2024-10-08 18:39:16 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
<EmojiButton {onEmoji} class="button button-neutral button-xs join-item">
|
2025-09-10 22:26:39 +00:00
|
|
|
<Icon icon={SmileCircle} size={4} />
|
2024-10-24 22:48:45 +00:00
|
|
|
</EmojiButton>
|