Files
flotilla/src/app/components/ContentMention.svelte
T
2025-04-15 15:07:54 -07:00

25 lines
715 B
Svelte

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