2024-09-25 20:46:10 +00:00
|
|
|
<script lang="ts">
|
2024-10-08 18:39:16 +00:00
|
|
|
import type {NativeEmoji} from "emoji-picker-element/shared"
|
2024-10-23 23:16:28 +00:00
|
|
|
import EmojiButton from "@lib/components/EmojiButton.svelte"
|
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"
|
2026-06-08 22:33:38 +00:00
|
|
|
import {publishReaction} from "@app/reactions"
|
|
|
|
|
import {canEnforceNip70} from "@app/relays"
|
2024-09-25 20:46:10 +00:00
|
|
|
|
2025-05-29 17:42:43 +00:00
|
|
|
const {url, event} = $props()
|
2024-12-16 21:33:34 +00:00
|
|
|
|
2025-08-19 21:03:04 +00:00
|
|
|
const shouldProtect = canEnforceNip70(url)
|
|
|
|
|
|
2025-07-30 23:30:03 +00:00
|
|
|
const onEmoji = async (emoji: NativeEmoji) =>
|
|
|
|
|
publishReaction({
|
|
|
|
|
event,
|
|
|
|
|
relays: [url],
|
|
|
|
|
content: emoji.unicode,
|
2025-08-19 21:03:04 +00:00
|
|
|
protect: await shouldProtect,
|
2025-07-30 23:30:03 +00:00
|
|
|
})
|
2024-09-25 20:46:10 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
<EmojiButton
|
|
|
|
|
{onEmoji}
|
|
|
|
|
class="button button-xs button-neutral join-item"
|
|
|
|
|
tippyParams={{placement: "bottom-end"}}>
|
2025-09-10 22:26:39 +00:00
|
|
|
<Icon icon={SmileCircle} size={4} />
|
2024-10-24 22:48:45 +00:00
|
|
|
</EmojiButton>
|