Files
flotilla/src/app/components/ProfileCircle.svelte
T

25 lines
633 B
Svelte

<script lang="ts">
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"
import {deriveDedupedProfile} from "@app/core/state"
type Props = {
pubkey?: string
class?: string
size?: number
url?: string
}
const {pubkey, url, size = 7, ...props}: Props = $props()
const profile = deriveDedupedProfile(pubkey, removeUndefined([url]))
</script>
<ImageIcon
{size}
alt=""
class={cx(props.class, "rounded-full")}
src={$profile?.picture || UserRounded} />