2024-10-04 00:04:00 +00:00
|
|
|
<script lang="ts">
|
2025-11-11 21:39:32 +00:00
|
|
|
import cx from "classnames"
|
|
|
|
|
import {removeUndefined} from "@welshman/lib"
|
|
|
|
|
import UserRounded from "@assets/icons/user-rounded.svg?dataurl"
|
|
|
|
|
import ImageIcon from "@lib/components/ImageIcon.svelte"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {profiles} from "@app/core"
|
2024-10-04 00:04:00 +00:00
|
|
|
|
2025-04-15 18:03:27 +00:00
|
|
|
type Props = {
|
2026-03-16 20:38:05 +00:00
|
|
|
pubkey?: string
|
2025-11-11 21:39:32 +00:00
|
|
|
class?: string
|
2026-06-24 20:56:53 +00:00
|
|
|
style?: string
|
2025-11-11 21:39:32 +00:00
|
|
|
size?: number
|
2025-04-15 18:03:27 +00:00
|
|
|
url?: string
|
2025-11-11 21:39:32 +00:00
|
|
|
}
|
2024-10-04 00:04:00 +00:00
|
|
|
|
2026-06-24 20:56:53 +00:00
|
|
|
const {pubkey, url, size = 7, style = undefined, ...props}: Props = $props()
|
2025-04-15 18:03:27 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const profile = $profiles.one(pubkey, removeUndefined([url]))
|
2024-10-04 00:04:00 +00:00
|
|
|
</script>
|
|
|
|
|
|
2025-11-11 21:39:32 +00:00
|
|
|
<ImageIcon
|
|
|
|
|
{size}
|
2026-06-24 20:56:53 +00:00
|
|
|
{style}
|
2025-11-13 16:59:32 +00:00
|
|
|
alt=""
|
2025-11-11 21:39:32 +00:00
|
|
|
class={cx(props.class, "rounded-full")}
|
2026-07-28 16:16:26 +00:00
|
|
|
src={$profile?.picture() || UserRounded} />
|