mirror of
https://github.com/Blah-IM/Weblah.git
synced 2025-05-01 00:31:08 +00:00

Move profile page to /settings/account/profile and replace CurrentAccountPicture with CurrentAccountIndicator component using the new account manager pattern. Update identity type to accept null instead of undefined.
19 lines
658 B
Svelte
19 lines
658 B
Svelte
<script lang="ts">
|
|
import manager from '$lib/accounts/manager.svelte';
|
|
import ProfilePicture from '$lib/components/ProfilePicture.svelte';
|
|
import { tw } from '$lib/tw';
|
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
|
|
interface Props extends HTMLAttributes<HTMLAnchorElement> {
|
|
class?: string;
|
|
}
|
|
|
|
const { class: classNames, ...rest }: Props = $props();
|
|
|
|
const currentAccount = $derived(manager.currentAccount);
|
|
const href = $derived(currentAccount ? '/settings/account/profile' : '/settings/account/add');
|
|
</script>
|
|
|
|
<a {href} class={tw('cursor-default', classNames)} {...rest}>
|
|
<ProfilePicture identity={currentAccount} size={32} />
|
|
</a>
|