This commit is contained in:
Timothy Jaeryang Baek 2025-12-21 16:10:51 +04:00
parent 0dd2cfe1f2
commit 5077676d33
2 changed files with 11 additions and 8 deletions

View file

@ -826,16 +826,16 @@
{#if knowledge?.write_access}
<div>
<AddContentMenu
on:upload={(e) => {
if (e.detail.type === 'directory') {
onUpload={(data) => {
if (data.type === 'directory') {
uploadDirectoryHandler();
} else if (e.detail.type === 'text') {
} else if (data.type === 'text') {
showAddTextContentModal = true;
} else {
document.getElementById('files-input').click();
}
}}
on:sync={(e) => {
onSync={() => {
showSyncConfirmModal = true;
}}
/>

View file

@ -15,6 +15,9 @@
export let onClose: Function = () => {};
export let onSync: Function = () => {};
export let onUpload: Function = (data) => {};
let show = false;
</script>
@ -59,7 +62,7 @@
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
dispatch('upload', { type: 'files' });
onUpload({ type: 'files' });
}}
>
<ArrowUpCircle strokeWidth="2" />
@ -69,7 +72,7 @@
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
dispatch('upload', { type: 'directory' });
onUpload({ type: 'directory' });
}}
>
<FolderOpen strokeWidth="2" />
@ -85,7 +88,7 @@
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
dispatch('sync', { type: 'directory' });
onSync();
}}
>
<ArrowPath strokeWidth="2" />
@ -96,7 +99,7 @@
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
dispatch('upload', { type: 'text' });
onUpload({ type: 'text' });
}}
>
<BarsArrowUp strokeWidth="2" />