Files
flotilla/src/app/components/ContentMention.svelte
T
2025-08-21 15:01:31 -07:00

24 lines
681 B
Svelte

<script lang="ts">
import {removeNil} from "@welshman/lib"
import type {ProfilePointer} from "@welshman/content"
import {deriveProfileDisplay} from "@welshman/app"
import Button from "@lib/components/Button.svelte"
import ProfileDetail from "@app/components/ProfileDetail.svelte"
import {pushModal} from "@app/util/modal"
type Props = {
value: ProfilePointer
url?: string
}
const {value, url}: Props = $props()
const display = deriveProfileDisplay(value.pubkey, removeNil([url]))
const openProfile = () => pushModal(ProfileDetail, {pubkey: value.pubkey, url})
</script>
<Button onclick={openProfile} class="link-content">
@{$display}
</Button>