2025-05-05 17:11:02 +00:00
|
|
|
<script lang="ts">
|
2026-08-21 20:47:06 +00:00
|
|
|
import {removeUndefined} from "@welshman/lib"
|
2025-05-05 17:11:02 +00:00
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
2025-09-10 22:26:39 +00:00
|
|
|
import CloseCircle from "@assets/icons/close-circle.svg?dataurl"
|
2025-05-05 17:11:02 +00:00
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Button from "@lib/components/Button.svelte"
|
2026-09-09 20:27:55 +00:00
|
|
|
import ComposeBar from "@app/components/ComposeBar.svelte"
|
2025-10-06 18:23:19 +00:00
|
|
|
import NoteContentMinimal from "@app/components/NoteContentMinimal.svelte"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {profiles} from "@app/core"
|
2025-05-05 17:11:02 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
type Props = {
|
2026-08-21 20:47:06 +00:00
|
|
|
url?: string
|
2025-05-05 17:11:02 +00:00
|
|
|
verb: string
|
|
|
|
|
event: TrustedEvent
|
|
|
|
|
clear: () => void
|
2026-07-28 16:16:26 +00:00
|
|
|
}
|
|
|
|
|
|
2026-08-21 20:47:06 +00:00
|
|
|
const {url, verb, event, clear}: Props = $props()
|
2026-07-28 16:16:26 +00:00
|
|
|
|
2026-08-21 20:47:06 +00:00
|
|
|
const display = $profiles.display(event.pubkey, removeUndefined([url])).$
|
2025-05-05 17:11:02 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-09-09 20:27:55 +00:00
|
|
|
<ComposeBar class="relative pr-8">
|
2026-07-28 16:16:26 +00:00
|
|
|
<p class="text-primary text-xs">{verb} @{$display}</p>
|
2025-05-05 17:11:02 +00:00
|
|
|
{#key event.id}
|
2025-10-06 18:23:19 +00:00
|
|
|
<NoteContentMinimal trimParent {event} />
|
2025-05-05 17:11:02 +00:00
|
|
|
{/key}
|
|
|
|
|
<Button class="absolute right-2 top-2 cursor-pointer" onclick={clear}>
|
2025-09-10 22:26:39 +00:00
|
|
|
<Icon icon={CloseCircle} />
|
2025-05-05 17:11:02 +00:00
|
|
|
</Button>
|
2026-09-09 20:27:55 +00:00
|
|
|
</ComposeBar>
|