📂 Adds file selection

This commit is contained in:
Rune Harlyk
2024-06-09 18:36:43 +02:00
committed by Rune Harlyk
parent 55347f1cac
commit 69733beb5e
5 changed files with 59 additions and 10 deletions
+13 -2
View File
@@ -1,7 +1,18 @@
<script>
import FileIcon from '~icons/mdi/file';
import { createEventDispatcher } from 'svelte';
export let name;
// $: type = name.slice(name.lastIndexOf('.') + 1);
const dispatch = createEventDispatcher();
const updateSelected = async () => {
dispatch('selected', { name });
}
</script>
<span class="flex pl-4 gap-2 items-center"><FileIcon/>{name}</span>
<!-- svelte-ignore a11y-interactive-supports-focus -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<span role="button" class="flex pl-4 gap-2 items-center" on:click={updateSelected}>
<FileIcon/>{name}
</span>