This commit is contained in:
Timothy Jaeryang Baek
2025-09-14 10:06:02 +02:00
parent c03ca7270e
commit b53ddfbd19
6 changed files with 71 additions and 36 deletions
@@ -27,7 +27,7 @@
const i18n = getContext('i18n');
export let selectedToolIds: string[] = [];
export let files = [];
export let selectedModels: string[] = [];
export let fileUploadCapableModels: string[] = [];
@@ -54,13 +54,28 @@
return /android|iphone|ipad|ipod|windows phone/i.test(userAgent);
};
function handleFileChange(event) {
const handleFileChange = (event) => {
const inputFiles = Array.from(event.target?.files);
if (inputFiles && inputFiles.length > 0) {
console.log(inputFiles);
inputFilesHandler(inputFiles);
}
}
};
const onSelect = (item) => {
if (files.find((f) => f.id === item.id)) {
return;
}
files = [
...files,
{
...item,
status: 'processed'
}
];
show = false;
};
</script>
<!-- Hidden file input used to open the camera on mobile -->
@@ -422,7 +437,7 @@
</div>
</button>
<Knowledge knowledge={$knowledge ?? []} />
<Knowledge knowledge={$knowledge ?? []} {onSelect} />
</div>
{:else if tab === 'notes'}
<div in:fly={{ x: 20, duration: 150 }}>
@@ -441,7 +456,7 @@
</div>
</button>
<Notes />
<Notes {onSelect} />
</div>
{:else if tab === 'chats'}
<div in:fly={{ x: 20, duration: 150 }}>
@@ -460,7 +475,7 @@
</div>
</button>
<Chats />
<Chats {onSelect} />
</div>
{/if}
</DropdownMenu.Content>