github-actions[bot]
GitHub deploy: 147a7d5cff70d15d1362635ac6a0b7800587e9c6
a4d7fd9
raw
history blame
829 Bytes
<script lang="ts">
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
import RecursiveFolder from './RecursiveFolder.svelte';
export let folders = {};
let folderList = [];
// Get the list of folders that have no parent, sorted by name alphabetically
$: folderList = Object.keys(folders)
.filter((key) => folders[key].parent_id === null)
.sort((a, b) =>
folders[a].name.localeCompare(folders[b].name, undefined, {
numeric: true,
sensitivity: 'base'
})
);
</script>
{#each folderList as folderId (folderId)}
<RecursiveFolder
className="px-2"
{folders}
{folderId}
on:import={(e) => {
dispatch('import', e.detail);
}}
on:update={(e) => {
dispatch('update', e.detail);
}}
on:change={(e) => {
dispatch('change', e.detail);
}}
/>
{/each}