2024-09-24 21:12:38 +00:00
|
|
|
<script lang="ts">
|
2026-08-21 20:47:06 +00:00
|
|
|
import {removeUndefined} from "@welshman/lib"
|
2025-04-15 18:03:27 +00:00
|
|
|
import type {ProfilePointer} from "@welshman/content"
|
2024-12-16 20:54:17 +00:00
|
|
|
import Button from "@lib/components/Button.svelte"
|
|
|
|
|
import ProfileDetail from "@app/components/ProfileDetail.svelte"
|
2026-06-08 21:14:40 +00:00
|
|
|
import {pushModal} from "@app/modal"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {profiles} from "@app/core"
|
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
|
|
|
|
2026-08-21 20:47:06 +00:00
|
|
|
const display = $profiles.display(value.pubkey, removeUndefined([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>
|
|
|
|
|
|
2025-02-04 01:21:46 +00:00
|
|
|
<Button onclick={openProfile} class="link-content">
|
2025-06-25 00:23:07 +00:00
|
|
|
@{$display}
|
2024-12-16 20:54:17 +00:00
|
|
|
</Button>
|