@@ -9,8 +9,8 @@ import useCaptureEvent from '@/hooks/useCaptureEvent';
99import { cn , getShortenedNumberDisplayString } from '@/lib/utils' ;
1010import isEqual from "fast-deep-equal/react" ;
1111import { useStickToBottom } from 'use-stick-to-bottom' ;
12- import { Brain , ChevronDown , ChevronRight , Clock , InfoIcon , Loader2 , ScanSearchIcon , Zap } from 'lucide-react' ;
13- import { memo , useCallback , useEffect , useState } from 'react' ;
12+ import { Brain , ChevronDown , ChevronRight , Clock , InfoIcon , Loader2 , ScanSearchIcon , Wrench , Zap } from 'lucide-react' ;
13+ import { memo , useCallback , useEffect , useMemo , useState } from 'react' ;
1414import { usePrevious } from '@uidotdev/usehooks' ;
1515import { SBChatMessageMetadata , SBChatMessagePart } from '../../types' ;
1616import { SearchScopeIcon } from '../searchScopeIcon' ;
@@ -46,6 +46,8 @@ const DetailsCardComponent = ({
4646} : DetailsCardProps ) => {
4747 const captureEvent = useCaptureEvent ( ) ;
4848
49+ const toolCallCount = useMemo ( ( ) => thinkingSteps . flat ( ) . filter ( part => part . type . startsWith ( 'tool-' ) ) . length , [ thinkingSteps ] ) ;
50+
4951 const handleExpandedChanged = useCallback ( ( next : boolean ) => {
5052 captureEvent ( 'wa_chat_details_card_toggled' , { chatId, isExpanded : next } ) ;
5153 onExpandedChanged ( next ) ;
@@ -140,6 +142,12 @@ const DetailsCardComponent = ({
140142 { Math . round ( metadata . totalResponseTimeMs / 1000 ) } seconds
141143 </ div >
142144 ) }
145+ { toolCallCount > 0 && (
146+ < div className = "flex items-center text-xs" >
147+ < Wrench className = "w-3 h-3 mr-1 flex-shrink-0" />
148+ { toolCallCount } tool call{ toolCallCount === 1 ? '' : 's' }
149+ </ div >
150+ ) }
143151 </ >
144152 ) }
145153 </ div >
0 commit comments