<script lang="ts">
	import { page } from '$app/stores';
	import Avatar from 'svelte-boring-avatars';

	$: user = $page.data.user;
</script>

{#if user?.avatar}
	<img
		src="data:image;base64,${user.avatar}"
		alt="Avatar de {user.pseudo}"
		class="h-9 w-9 rounded-full object-cover"
	/>
{:else}
	<Avatar name={user?.pseudo} size={35} variant="beam" />
{/if}
