migrate: convert most components to svelte 5

This commit is contained in:
Xylight committed 2024-10-25 19:33:27 -07:00
1 parent d670f39f0a
commit 10ef4123da
225 files changed
+5441 -3341

No files matched your search

+15 -5
View File
@@ -1,15 +1,25 @@
<script lang="ts">
import Avatar from './Avatar.svelte'
export let name: string
export let label: string | undefined = undefined
export let icon: string | undefined = undefined
interface Props {
name: string
label?: string | undefined
icon?: string | undefined
customIcon?: import('svelte').Snippet
}
let {
name,
label = undefined,
icon = undefined,
customIcon,
}: Props = $props()
</script>
<div class="flex flex-row gap-2 items-center">
<slot name="icon">
{#if customIcon}{@render customIcon()}{:else}
<Avatar url={icon} width={32} />
</slot>
{/if}
<div class="flex flex-col">
<span class="font-semibold text-base">{name}</span>
<span class="text-sm">{label}</span>