diff --git a/components/chat-input.tsx b/components/chat-input.tsx index c03b688..08bfcb1 100644 --- a/components/chat-input.tsx +++ b/components/chat-input.tsx @@ -3,6 +3,7 @@ import React, { useCallback, useRef, useEffect, useState } from "react"; import { Button } from "@/components/ui/button"; import { Textarea } from "@/components/ui/textarea"; +import { ResetWarningModal } from "@/components/reset-warning-modal"; import { Loader2, Send, @@ -17,14 +18,6 @@ import { TooltipProvider, TooltipTrigger, } from "@/components/ui/tooltip"; -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog"; import Image from "next/image"; import { useDiagram } from "@/contexts/diagram-context"; @@ -233,35 +226,11 @@ export function ChatInput({ {/* Warning Modal */} - - - - Clear Everything? - - This will clear the current conversation and - reset the diagram. This action cannot be - undone. - - - - - - - - + onClear={handleClear} + /> void; + onClear: () => void; +} + +export function ResetWarningModal({ + open, + onOpenChange, + onClear, +}: ResetWarningModalProps) { + return ( + + + + Clear Everything? + + This will clear the current conversation and reset the + diagram. This action cannot be undone. + + + + + + + + + ); +}