{/* Header */}
{getToolIcon(current.toolName)}
{current.source !== 'lead' ? `${current.source} — ` : ''}
{current.toolName}
{selectedTeamName !== current.teamName && (
{displayName}
)}
{/* Tool input preview (syntax-highlighted) */}
{/* Diff preview (Write/Edit/NotebookEdit only) */}
{/* Error feedback */}
{error && (
)}
{/* Actions */}
handleRespond(true)}
className="rounded-md px-3.5 py-1.5 text-xs font-medium text-white transition-colors disabled:opacity-50"
style={{ backgroundColor: 'rgb(5, 150, 105)' }}
onMouseEnter={(e) => {
if (!disabled)
Object.assign(e.currentTarget.style, { backgroundColor: 'rgb(16, 185, 129)' });
}}
onMouseLeave={(e) => {
Object.assign(e.currentTarget.style, { backgroundColor: 'rgb(5, 150, 105)' });
}}
>
Allow
handleRespond(false)}
className="rounded-md border px-3.5 py-1.5 text-xs font-medium transition-colors disabled:opacity-50"
style={{
borderColor: 'rgba(239, 68, 68, 0.5)',
color: 'rgb(248, 113, 113)',
}}
onMouseEnter={(e) => {
if (!disabled)
Object.assign(e.currentTarget.style, {
backgroundColor: 'rgba(239, 68, 68, 0.1)',
});
}}
onMouseLeave={(e) => {
Object.assign(e.currentTarget.style, { backgroundColor: 'transparent' });
}}
>
Deny
void updateToolApprovalSettings({ autoAllowAll: true })}
className="rounded-md border px-3.5 py-1.5 text-xs font-medium transition-colors"
style={{
color: 'var(--color-text-muted)',
borderColor: 'var(--color-border-emphasis)',
}}
onMouseEnter={(e) => {
Object.assign(e.currentTarget.style, {
color: 'var(--color-text-secondary)',
backgroundColor: 'var(--color-surface-raised)',
});
}}
onMouseLeave={(e) => {
Object.assign(e.currentTarget.style, {
color: 'var(--color-text-muted)',
backgroundColor: 'transparent',
});
}}
>
Allow all
{pendingApprovals.length > 1 && (
{pendingApprovals.length - 1} pending
)}
{/* Timeout progress bar */}
>
);
};
// ---------------------------------------------------------------------------
// Syntax-highlighted tool input preview
// ---------------------------------------------------------------------------
const FILE_TOOLS = new Set(['Edit', 'Read', 'Write', 'NotebookEdit']);
const ToolInputPreview = ({
toolName,
toolInput,
projectPath,
}: {
toolName: string;
toolInput: Record