diff --git a/src/components/ThinkBox.tsx b/src/components/ThinkBox.tsx index 9c6a576..f830945 100644 --- a/src/components/ThinkBox.tsx +++ b/src/components/ThinkBox.tsx @@ -1,15 +1,23 @@ 'use client'; -import { useState } from 'react'; -import { cn } from '@/lib/utils'; +import { useEffect, useState } from 'react'; import { ChevronDown, ChevronUp, BrainCircuit } from 'lucide-react'; interface ThinkBoxProps { content: string; + thinkingEnded: boolean; } -const ThinkBox = ({ content }: ThinkBoxProps) => { - const [isExpanded, setIsExpanded] = useState(false); +const ThinkBox = ({ content, thinkingEnded }: ThinkBoxProps) => { + const [isExpanded, setIsExpanded] = useState(true); + + useEffect(() => { + if (thinkingEnded) { + setIsExpanded(false); + } else { + setIsExpanded(true); + } + }, [thinkingEnded]); return (