@@ -203,11 +203,7 @@ const AIErrorMessage = memo(({ errorMessage, onClear }: AIErrorMessageProps) =>
203203
204204AIErrorMessage . displayName = "AIErrorMessage" ;
205205
206- interface AIPanelProps {
207- onClose ?: ( ) => void ;
208- }
209-
210- const AIPanelComponentInner = memo ( ( { onClose } : AIPanelProps ) => {
206+ const AIPanelComponentInner = memo ( ( ) => {
211207 const [ isDragOver , setIsDragOver ] = useState ( false ) ;
212208 const [ isReactDndDragOver , setIsReactDndDragOver ] = useState ( false ) ;
213209 const [ initialLoadDone , setInitialLoadDone ] = useState ( false ) ;
@@ -256,10 +252,6 @@ const AIPanelComponentInner = memo(({ onClose }: AIPanelProps) => {
256252
257253 // console.log("AICHAT messages", messages);
258254
259- const handleClearChat = useCallback ( ( ) => {
260- model . clearChat ( ) ;
261- } , [ model ] ) ;
262-
263255 const handleKeyDown = ( waveEvent : WaveKeyboardEvent ) : boolean => {
264256 if ( checkKeyPressed ( waveEvent , "Cmd:k" ) ) {
265257 model . clearChat ( ) ;
@@ -493,7 +485,7 @@ const AIPanelComponentInner = memo(({ onClose }: AIPanelProps) => {
493485 >
494486 { ( isDragOver || isReactDndDragOver ) && < AIDragOverlay /> }
495487 { showBlockMask && < AIBlockMask /> }
496- < AIPanelHeader onClose = { onClose } model = { model } onClearChat = { handleClearChat } />
488+ < AIPanelHeader />
497489 < AIRateLimitStrip />
498490
499491 < div key = "main-content" className = "flex-1 flex flex-col min-h-0" >
@@ -504,15 +496,15 @@ const AIPanelComponentInner = memo(({ onClose }: AIPanelProps) => {
504496 { messages . length === 0 && initialLoadDone ? (
505497 < div
506498 className = "flex-1 overflow-y-auto p-2"
507- onContextMenu = { ( e ) => handleWaveAIContextMenu ( e , onClose ) }
499+ onContextMenu = { ( e ) => handleWaveAIContextMenu ( e , true ) }
508500 >
509501 { model . inBuilder ? < AIBuilderWelcomeMessage /> : < AIWelcomeMessage /> }
510502 </ div >
511503 ) : (
512504 < AIPanelMessages
513505 messages = { messages }
514506 status = { status }
515- onContextMenu = { ( e ) => handleWaveAIContextMenu ( e , onClose ) }
507+ onContextMenu = { ( e ) => handleWaveAIContextMenu ( e , true ) }
516508 />
517509 ) }
518510 { errorMessage && (
@@ -529,10 +521,10 @@ const AIPanelComponentInner = memo(({ onClose }: AIPanelProps) => {
529521
530522AIPanelComponentInner . displayName = "AIPanelInner" ;
531523
532- const AIPanelComponent = ( { onClose } : AIPanelProps ) => {
524+ const AIPanelComponent = ( ) => {
533525 return (
534526 < ErrorBoundary >
535- < AIPanelComponentInner onClose = { onClose } />
527+ < AIPanelComponentInner />
536528 </ ErrorBoundary >
537529 ) ;
538530} ;
0 commit comments