From 58fed4656754938c73c0354a5d6e42acf7c44044 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Thu, 23 Oct 2025 19:35:52 +0200 Subject: [PATCH] updae chat config madal --- .../components/chat/ChatPanel/ConfigModal.tsx | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 surfsense_web/components/chat/ChatPanel/ConfigModal.tsx diff --git a/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx b/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx new file mode 100644 index 000000000..77b617f5f --- /dev/null +++ b/surfsense_web/components/chat/ChatPanel/ConfigModal.tsx @@ -0,0 +1,66 @@ +"use client"; + +import { Pencil } from "lucide-react"; +import { useCallback, useContext } from "react"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import { chatInterfaceContext } from "../ChatInterface"; +import type { GeneratePodcastRequest } from "./actions"; + +interface ConfigModalProps { + generatePodcast: (request: GeneratePodcastRequest) => Promise; +} + +export function ConfigModal(props: ConfigModalProps) { + const context = useContext(chatInterfaceContext); + + if (!context) { + throw new Error("chatInterfaceContext must be used within a ChatProvider"); + } + const { chatDetails } = context; + const { generatePodcast } = props; + + const handleGeneratePost = useCallback(async () => { + if (!chatDetails) return; + await generatePodcast({ + type: "CHAT", + ids: [chatDetails.id], + search_space_id: chatDetails.search_space_id, + podcast_title: chatDetails.title, + }); + }, [chatDetails]); + return ( + + + + + +
+ + + + + +
+
+
+ ); +}