mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-02 16:52:31 +00:00
basic file operations
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user