diff --git a/src/frontend/src/modals/IOModal/components/chatView/index.tsx b/src/frontend/src/modals/IOModal/components/chatView/index.tsx index a625cd611..61cf44516 100644 --- a/src/frontend/src/modals/IOModal/components/chatView/index.tsx +++ b/src/frontend/src/modals/IOModal/components/chatView/index.tsx @@ -18,6 +18,12 @@ import { chatViewProps } from "../../../../types/components"; import { classNames } from "../../../../utils/utils"; import ChatInput from "./chatInput"; import ChatMessage from "./chatMessage"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, +} from "../../../../components/ui/select"; export default function ChatView({ sendMessage, @@ -118,10 +124,21 @@ export default function ChatView({ if (lockChat) setLockChat(false); } + function handleSelectChange(event: string): void { + switch (event) { + case "builds": + clearChat(); + break; + case "buildsNSession": + console.log("delete build and session"); + break; + } + } + function updateChat( chat: ChatMessageType, message: string, - stream_url?: string + stream_url?: string, ) { // if (message === "") return; chat.message = message; @@ -149,18 +166,44 @@ export default function ChatView({
- +
{chatHistory?.length > 0 ? ( diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index e23557a84..c7f65f108 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -752,3 +752,17 @@ export type toolbarSelectItemProps = { dataTestId: string; ping?: boolean; }; + +export type clearChatPropsType = { + lockChat: boolean; + setLockChat: (lock: boolean) => void; + setChatHistory: (chatHistory: ChatMessageType) => void; + method: string; +}; + +export type handleSelectPropsType = { + event: string; + lockChat: boolean; + setLockChat: (lock: boolean) => void; + setChatHistory: (chatHistory: ChatMessageType) => void; +};