flotilla/src/app/components/RoomItemEmojiButton.svelte

25 lines
711 B
Svelte
Raw Normal View History

2024-09-25 20:46:10 +00:00
<script lang="ts">
2026-07-28 16:16:26 +00:00
import type {TrustedEvent} from "@welshman/util"
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"
import {publishReaction} from "@app/reactions"
2024-09-25 20:46:10 +00:00
2026-07-28 16:16:26 +00:00
type Props = {
url: string
event: TrustedEvent
}
2026-07-28 16:16:26 +00:00
const {url, event}: Props = $props()
const onEmoji = (emoji: string) => publishReaction(event, {content: emoji, tags: []}, {url})
2024-09-25 20:46:10 +00:00
</script>
<EmojiButton
aria-label="Add a reaction"
{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>