카테고리 목록에서 파일 목록을 재귀적으로 표시할 수 있는 기능 구현

This commit is contained in:
static
2025-01-22 22:24:44 +09:00
parent 8f8bad6d10
commit f34764ffe0
9 changed files with 98 additions and 41 deletions

View File

@@ -0,0 +1,23 @@
<script lang="ts">
import type { Snippet } from "svelte";
import IconCheckCircle from "~icons/material-symbols/check-circle";
import IconCheckCircleOutline from "~icons/material-symbols/check-circle-outline";
interface Props {
children: Snippet;
checked?: boolean;
}
let { children, checked = $bindable(false) }: Props = $props();
</script>
<label class="flex items-center justify-center gap-x-1">
<input bind:checked type="checkbox" class="hidden" />
{@render children?.()}
{#if checked}
<IconCheckCircle class="text-primary-600" />
{:else}
<IconCheckCircleOutline class="text-gray-300" />
{/if}
</label>