2024-05-16 18:18:42 +02:00
|
|
|
<script lang="ts">
|
|
|
|
import CollapsibleTree from '$lib/components/collapsible-tree/CollapsibleTree.svelte';
|
|
|
|
import FileListNode from '$lib/components/file-list/FileListNode.svelte';
|
|
|
|
|
|
|
|
import type { GPXFileWithStatistics } from '$lib/db';
|
2024-05-17 15:02:45 +02:00
|
|
|
import { createEventDispatcher } from 'svelte';
|
2024-05-16 18:18:42 +02:00
|
|
|
import type { Readable } from 'svelte/store';
|
|
|
|
|
|
|
|
export let file: Readable<GPXFileWithStatistics | undefined>;
|
2024-05-17 15:02:45 +02:00
|
|
|
|
|
|
|
const dispatch = createEventDispatcher();
|
|
|
|
|
|
|
|
function forwardId() {
|
|
|
|
dispatch('click', { id: $file?.file._data.id });
|
|
|
|
}
|
2024-05-16 18:18:42 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{#if $file}
|
2024-05-17 12:20:46 +02:00
|
|
|
<CollapsibleTree side="left" margin={4} defaultState="closed">
|
2024-05-17 15:02:45 +02:00
|
|
|
<FileListNode node={$file.file} id={$file.file._data.id} on:click={forwardId} />
|
2024-05-16 18:18:42 +02:00
|
|
|
</CollapsibleTree>
|
|
|
|
{/if}
|