mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
27 lines
855 B
Svelte
27 lines
855 B
Svelte
<script lang="ts">
|
|
import Tree from '$lib/components/shared-components/tree/tree.svelte';
|
|
import { normalizeTreePath, type RecursiveObject } from '$lib/utils/tree-utils';
|
|
|
|
interface Props {
|
|
items: RecursiveObject;
|
|
parent?: string;
|
|
active?: string;
|
|
icons: { default: string; active: string };
|
|
getLink: (path: string) => string;
|
|
getColor?: (path: string) => string | undefined;
|
|
}
|
|
|
|
let { items, parent = '', active = '', icons, getLink, getColor = () => undefined }: Props = $props();
|
|
</script>
|
|
|
|
<ul class="list-none ml-2">
|
|
{#each Object.entries(items) as [path, tree]}
|
|
{@const value = normalizeTreePath(`${parent}/${path}`)}
|
|
{@const key = value + getColor(value)}
|
|
{#key key}
|
|
<li>
|
|
<Tree {parent} value={path} {tree} {icons} {active} {getLink} {getColor} />
|
|
</li>
|
|
{/key}
|
|
{/each}
|
|
</ul>
|