flotilla/src/app/components/ContentMention.svelte

24 lines
682 B
Svelte
Raw Normal View History

2024-09-24 21:12:38 +00:00
<script lang="ts">
2025-04-15 18:03:27 +00:00
import type {ProfilePointer} from "@welshman/content"
2024-09-24 21:12:38 +00:00
import {displayProfile} from "@welshman/util"
2024-12-16 20:54:17 +00:00
import Button from "@lib/components/Button.svelte"
import ProfileDetail from "@app/components/ProfileDetail.svelte"
import {pushModal} from "@app/modal"
2025-04-15 22:45:48 +00:00
import {deriveAliasedProfile} from "@app/state"
2024-09-24 21:12:38 +00:00
2025-04-15 18:03:27 +00:00
type Props = {
value: ProfilePointer
url?: string
}
2024-09-24 21:12:38 +00:00
2025-04-15 18:03:27 +00:00
const {value, url}: Props = $props()
2024-12-16 20:54:17 +00:00
2025-04-15 22:45:48 +00:00
const profile = deriveAliasedProfile(value.pubkey, url)
2025-04-15 18:03:27 +00:00
const openProfile = () => pushModal(ProfileDetail, {pubkey: value.pubkey, url})
2024-09-24 21:12:38 +00:00
</script>
<Button onclick={openProfile} class="link-content">
2025-04-15 22:45:48 +00:00
@{displayProfile($profile)}
2024-12-16 20:54:17 +00:00
</Button>