refactor: ProfilePicture to use Identity instead of Account

This commit is contained in:
Shibo Lyu 2025-04-14 00:28:55 +08:00
parent 308eef1cff
commit 055f7240df

View file

@ -1,25 +1,25 @@
<script lang="ts"> <script lang="ts">
import type { Account } from '$lib/accounts/accountStore'; import type { BlahIdentityDescription } from '@blah-im/core/identity';
import { AvatarBeam } from 'svelte-boring-avatars'; import { AvatarBeam } from 'svelte-boring-avatars';
interface Props { interface Props {
account: Account | undefined; identity: BlahIdentityDescription | undefined;
size?: number; size?: number;
} }
let { account, size = 32 }: Props = $props(); let { identity, size = 32 }: Props = $props();
</script> </script>
{#if account} {#if identity}
{#key account.id_key} {#key identity.id_key}
<AvatarBeam {size} name={account.id_key} /> <AvatarBeam {size} name={identity.id_key} />
{/key} {/key}
<span class="sr-only">{account.profile.signee.payload.name}</span> <span class="sr-only">{identity.profile.signee.payload.name}</span>
{:else} {:else}
<div <div
class="border-ss-primary box-border size-(--weblah-profile-pic-size) rounded-full border-2 border-dashed" class="border-ss-primary box-border size-(--weblah-profile-pic-size) rounded-full border-2 border-dashed"
style:--weblah-profile-pic-size={`${size}px`} style:--weblah-profile-pic-size={`${size}px`}
aria-hidden="true" aria-hidden="true"
></div> ></div>
<span class="sr-only">Account Unavailable</span> <span class="sr-only">Identity Unavailable</span>
{/if} {/if}