basic file operations

This commit is contained in:
vcoppe
2024-04-18 15:30:19 +02:00
parent d800ff5540
commit 78258454be
7 changed files with 218 additions and 39 deletions

View File

@@ -1,16 +1,30 @@
<script lang="ts">
import { files } from '$lib/stores';
import { files, selectedFiles, addSelectFile, selectFile } from '$lib/stores';
import { ScrollArea } from '$lib/components/ui/scroll-area/index.js';
import { Button } from '$lib/components/ui/button';
import { Label } from '$lib/components/ui/label';
</script>
<ScrollArea class="w-full h-full">
<div class="flex flex-col">
{#each $files as file}
<Button variant="outline" class="w-full">
{file.metadata.name}
</Button>
{/each}
</div>
</ScrollArea>
<div class="flex flex-col h-full w-full">
<Label class="w-full">Files</Label>
<ScrollArea class="w-full h-full">
<div class="flex flex-col">
{#each $files as file}
<Button
variant={$selectedFiles.has(file) ? 'outline' : 'secondary'}
class="w-full {$selectedFiles.has(file) ? 'hover:bg-background' : 'hover:bg-secondary'}"
on:click={(e) => {
if (e.shiftKey) {
addSelectFile(file);
} else {
selectFile(file);
}
}}
>
{file.metadata.name}
</Button>
{/each}
</div>
</ScrollArea>
</div>