feat: chat ui and functionality for prompts (auto-send not working)

This commit is contained in:
Dustin Healy 2025-09-06 00:12:43 -07:00
parent 7c3356e10b
commit 607a5a2fcf
18 changed files with 636 additions and 19 deletions

View file

@ -1,5 +1,6 @@
import { v4 } from 'uuid';
import { cloneDeep } from 'lodash';
import { useMemo } from 'react';
import { useQueryClient } from '@tanstack/react-query';
import {
Constants,
@ -213,17 +214,18 @@ export default function useChatFunctions({
submissionFiles.length > 0;
if (setFiles && reuseFiles === true) {
currentMsg.files = [...submissionFiles];
currentMsg.files = submissionFiles;
setFiles(new Map());
setFilesToDelete({});
} else if (setFiles && files && files.size > 0) {
currentMsg.files = Array.from(files.values()).map((file) => ({
const chatFiles = Array.from(files.values()).map((file) => ({
file_id: file.file_id,
filepath: file.filepath,
type: file.type ?? '', // Ensure type is not undefined
height: file.height,
width: file.width,
}));
currentMsg.files = chatFiles;
setFiles(new Map());
setFilesToDelete({});
}