immich/web/src/lib/components/elements/badge.svelte

19 lines
456 B
Svelte
Raw Normal View History

<script lang="ts">
import type { Snippet } from 'svelte';
interface Props {
2025-06-12 19:06:38 -04:00
rounded?: boolean | 'full';
children?: Snippet;
}
2025-06-12 19:06:38 -04:00
let { rounded = true, children }: Props = $props();
</script>
<span
2025-06-12 19:06:38 -04:00
class="bg-primary text-subtle inline-block h-min whitespace-nowrap px-3 py-1 text-center align-baseline text-xs leading-none"
class:rounded-md={rounded === true}
class:rounded-full={rounded === 'full'}
>
{@render children?.()}
</span>