Files
gpx.studio/website/src/lib/components/file-list/FileList.svelte

26 lines
855 B
Svelte
Raw Normal View History

2024-05-16 18:18:42 +02:00
<script lang="ts">
import { ScrollArea } from '$lib/components/ui/scroll-area/index';
2024-05-17 15:02:45 +02:00
import FileListNode from './FileListNode.svelte';
2024-05-16 18:18:42 +02:00
import { fileObservers } from '$lib/db';
2024-05-21 13:22:14 +02:00
import { setContext } from 'svelte';
2024-05-22 16:05:31 +02:00
import { ListRootItem } from './FileList';
2024-05-21 13:22:14 +02:00
export let orientation: 'vertical' | 'horizontal';
export let recursive = false;
2024-05-21 13:22:14 +02:00
setContext('orientation', orientation);
setContext('recursive', recursive);
2024-05-16 18:18:42 +02:00
</script>
<ScrollArea
2024-05-23 12:57:24 +02:00
class="shrink-0 {orientation === 'vertical' ? 'p-1 pr-3' : 'h-10 px-1'}"
{orientation}
scrollbarXClasses={orientation === 'vertical' ? '' : 'mt-1 h-2'}
scrollbarYClasses={orientation === 'vertical' ? '' : ''}
>
<div class="flex {orientation === 'vertical' ? 'flex-col' : 'flex-row'} {$$props.class ?? ''}">
2024-05-23 11:21:57 +02:00
<FileListNode bind:node={$fileObservers} item={new ListRootItem()} />
2024-05-16 18:18:42 +02:00
</div>
</ScrollArea>