{/* Clickable Header */}
{
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
onClick();
}
}}
className="group flex cursor-pointer items-center gap-2 rounded px-2 py-1.5"
style={{ backgroundColor: 'transparent' }}
onMouseEnter={(e) =>
Object.assign(e.currentTarget.style, { backgroundColor: 'var(--tool-item-hover-bg)' })
}
onMouseLeave={(e) =>
Object.assign(e.currentTarget.style, { backgroundColor: 'transparent' })
}
>
{/* Icon */}
{icon}
{/* Label */}
{label}
{/* Separator and Summary */}
{summary && (
<>
-
{summary}
>
)}
{/* Spacer if no summary */}
{!summary && }
{/* Token count badge */}
{tokenCount != null && tokenCount > 0 && (
~{formatTokens(tokenCount)} {tokenLabel}
)}
{/* Status indicator - hidden when notification dot replaces it */}
{status && !notificationDotColor && }
{/* Notification dot (replaces status dot when present) */}
{notificationDotColor && (
)}
{/* Duration */}
{durationMs !== undefined && (
{formatDuration(durationMs)}
)}
{/* Expand/collapse chevron */}
{hasExpandableContent && (
)}
{/* Expanded Content */}
{isExpanded && children && (
{children}
)}
);
};