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';
|
|
|
|
</script>
|
|
|
|
|
2024-04-19 16:13:08 +02:00
|
|
|
<div class="absolute h-10 -translate-y-10 w-fit max-w-full bg-secondary rounded-t px-1">
|
|
|
|
<ScrollArea orientation="horizontal" class="w-full h-full" scrollbarXClasses="h-2">
|
|
|
|
<div class="flex flex-row gap-1">
|
2024-04-18 15:30:19 +02:00
|
|
|
{#each $files as file}
|
2024-04-19 16:13:08 +02:00
|
|
|
<button
|
|
|
|
class="my-1 px-1.5 py-1 rounded {$selectedFiles.has(file)
|
|
|
|
? 'bg-background shadow'
|
|
|
|
: 'bg-secondary'}"
|
2024-04-18 15:30:19 +02:00
|
|
|
on:click={(e) => {
|
|
|
|
if (e.shiftKey) {
|
|
|
|
addSelectFile(file);
|
|
|
|
} else {
|
|
|
|
selectFile(file);
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{file.metadata.name}
|
2024-04-19 16:13:08 +02:00
|
|
|
</button>
|
2024-04-18 15:30:19 +02:00
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
</ScrollArea>
|
|
|
|
</div>
|