@@ -22,7 +22,7 @@ import Link from "next/link";
2222import { StreamLanguage } from "@codemirror/language" ;
2323import CardSection from "@code0-tech/pictor/dist/components/card/CardSection" ;
2424import { Select } from "@radix-ui/react-select" ;
25- import { IconChevronDown , IconPlayerStop , IconSend , IconSparkles2Filled } from "@tabler/icons-react" ;
25+ import { IconChevronDown , IconPlayerStop , IconSend , IconSparkles2Filled , IconX } from "@tabler/icons-react" ;
2626import { AIService } from "@edition/ai/services/AI.service" ;
2727import { motion } from "framer-motion" ;
2828import { AiGenerateFlowSubscriptionPayload , Flow , NamespaceProject } from "@code0-tech/sagittarius-graphql-types" ;
@@ -34,12 +34,13 @@ export interface AIChatComponentProps {
3434 flowId ?: Flow [ 'id' ]
3535 prompt ?: string
3636 onData ?: ( data : AiGenerateFlowSubscriptionPayload ) => string | void
37+ onClose ?: ( ) => void
3738
3839}
3940
4041export const AIChatComponent : React . FC < AIChatComponentProps > = ( props ) => {
4142
42- const { projectId, flowId, prompt = "" , onData} = props
43+ const { projectId, flowId, prompt = "" , onData, onClose } = props
4344
4445 const aiService = useService ( AIService )
4546 const aiStore = useStore ( AIService )
@@ -257,6 +258,11 @@ export const AIChatComponent: React.FC<AIChatComponentProps> = (props) => {
257258 < IconSend size = { 13 } />
258259 </ Button >
259260 ) }
261+ { onClose ? (
262+ < Button onClick = { onClose } variant = { "none" } color = { "secondary" } >
263+ < IconX size = { 13 } />
264+ </ Button >
265+ ) : null }
260266 </ Flex >
261267 </ Flex >
262268 </ CardSection >
0 commit comments