mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-14 22:08:45 +00:00
32 lines
799 B
Svelte
32 lines
799 B
Svelte
<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 { class: className, name, subtext, textClass: textClassName, type }: 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={className}
|
|
textClass={textClassName}
|
|
>
|
|
{name}
|
|
</IconLabel>
|