import { assessmentColor } from '@renderer/utils/reportAssessments'; import { Wrench } from 'lucide-react'; import { AssessmentBadge } from '../AssessmentBadge'; import { ReportSection, sectionId } from '../ReportSection'; import type { ReportToolUsage } from '@renderer/types/sessionReport'; interface ToolSectionProps { data: ReportToolUsage; defaultCollapsed?: boolean; } export const ToolSection = ({ data, defaultCollapsed }: ToolSectionProps) => { const toolEntries = Object.entries(data.successRates).sort( (a, b) => b[1].totalCalls - a[1].totalCalls ); return (
{data.totalCalls.toLocaleString()} total calls across {toolEntries.length} tools
{toolEntries.map(([tool, stats]) => { const color = assessmentColor(stats.assessment); return ( ); })}
Tool Calls Errors Success % Health
{tool} {stats.totalCalls.toLocaleString()} {stats.errors > 0 ? ( ) : ( stats.errors.toLocaleString() )} {stats.successRatePct}%
); };