IconEntryButton 컴포넌트 추가

This commit is contained in:
static
2025-01-26 22:04:53 +09:00
parent c709a79266
commit 32ecf46341
13 changed files with 186 additions and 93 deletions

View File

@@ -0,0 +1,31 @@
<script lang="ts">
import type { ClassValue } from "svelte/elements";
import { IconLabel } from "$lib/components/molecules";
import IconFolder from "~icons/material-symbols/folder";
import IconDraft from "~icons/material-symbols/draft";
interface Props {
class?: ClassValue;
name: string;
subtext?: string;
textClass?: ClassValue;
type: "directory" | "file";
}
let { name, subtext, type, ...props }: Props = $props();
</script>
{#snippet subtextSnippet()}
{subtext}
{/snippet}
<IconLabel
icon={type === "directory" ? IconFolder : IconDraft}
iconClass={type === "file" ? "text-blue-400" : undefined}
subtext={subtext ? subtextSnippet : undefined}
class={props.class}
textClass={props.textClass}
>
{name}
</IconLabel>