Files
radicle-explorer/shared/ui/components/UserAvatar.svelte
T
Rūdolfs Ošiņš f79b23dde7 Share UI code through an npm workspace
Extracts the avatar components and the style tokens into shared/ui, which
both apps consume as a workspace package, to try out ADR 2. Nix and the
Docker setups are not updated yet.
2026-10-29 16:27:03 +01:00

27 lines
510 B
Svelte

<script lang="ts">
import { cachedUserAvatar } from "../lib/avatar";
interface Props {
nodeId: string;
styleWidth: string;
}
const { nodeId, styleWidth }: Props = $props();
let dataUri: string | undefined = $state(undefined);
$effect(() => {
void cachedUserAvatar(nodeId.replace("did:key:", "")).then(data => {
dataUri = data;
});
});
</script>
{#if dataUri}
<img
style:width={styleWidth}
style:height={styleWidth}
src={dataUri}
alt="Avatar" />
{/if}