📂 Adds file selection
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user