2024-04-18 10:52:45 +02:00
|
|
|
<script lang="ts">
|
2024-04-18 15:30:19 +02:00
|
|
|
import { files, selectedFiles, addSelectFile, selectFile } from '$lib/stores';
|
2024-04-18 10:52:45 +02:00
|
|
|
|
|
|
|
import { ScrollArea } from '$lib/components/ui/scroll-area/index.js';
|
|
|
|
import { Button } from '$lib/components/ui/button';
|
2024-04-18 15:30:19 +02:00
|
|
|
import { Label } from '$lib/components/ui/label';
|
2024-04-18 10:52:45 +02:00
|
|
|
</script>
|
|
|
|
|
2024-04-18 15:30:19 +02:00
|
|
|
<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>
|