Files
immich/web/src/lib/components/shared-components/tree/tree-items.svelte
renovate[bot] 3d6a6f77a8 chore(deps): update dependency eslint-plugin-svelte to v3 (#16532)
* chore(deps): update dependency eslint-plugin-svelte to v3

* chore: linting

* chore: rebase

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
Co-authored-by: Zack Pollard <zackpollard@ymail.com>
2025-03-03 14:24:26 +00:00

29 lines
922 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">
<!-- eslint-disable-next-line svelte/require-each-key -->
{#each Object.entries(items).sort() 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>