Files
windmill/frontend/src/lib/components/common/button/RoundIconButton.svelte
T
2026-03-02 10:32:01 +01:00

19 lines
530 B
Svelte

<script lang="ts">
interface Props {
color?: 'light' | 'dark' | undefined;
border?: boolean;
children?: import('svelte').Snippet;
}
let { color = 'light', border = false, children }: Props = $props();
let colorClasses = $derived({
light: 'text-primary bg-surface hover:bg-surface-hover text-primary',
dark: 'text-primary hover:bg-surface-hover-dark text-primary'
}[color ?? 'light'])
</script>
<div class="rounded-full p-1 {colorClasses} {border ? 'border border-tertiary' : ''}">
{@render children?.()}
</div>