feat: profile page + 404 page + refactor code
This commit is contained in:
parent
3f137e5c3c
commit
d692e86fe0
17 changed files with 1282 additions and 313 deletions
26
website/src/lib/components/self/ProfileBadges.svelte
Normal file
26
website/src/lib/components/self/ProfileBadges.svelte
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<script lang="ts">
|
||||
import type { UserProfile } from '$lib/types/user-profile';
|
||||
import SilentBadge from './SilentBadge.svelte';
|
||||
import { Hash, Hammer } from 'lucide-svelte';
|
||||
|
||||
let {
|
||||
user,
|
||||
showId = true,
|
||||
size = 'default'
|
||||
}: {
|
||||
user: UserProfile;
|
||||
showId?: boolean;
|
||||
size?: 'sm' | 'default';
|
||||
} = $props();
|
||||
|
||||
let badgeClass = $derived(size === 'sm' ? 'text-xs' : '');
|
||||
</script>
|
||||
|
||||
<div class="flex items-center">
|
||||
{#if showId}
|
||||
<SilentBadge icon={Hash} class="text-muted-foreground {badgeClass}" text="#{user.id} to join" />
|
||||
{/if}
|
||||
{#if user.isAdmin}
|
||||
<SilentBadge icon={Hammer} text="Admin" class="text-primary {badgeClass}" />
|
||||
{/if}
|
||||
</div>
|
||||
Reference in a new issue