import { memo } from "react"; import { type PendingApproval } from "../../session-logic"; import { cn } from "~/lib/utils"; interface ComposerPendingApprovalPanelProps { approval: PendingApproval; pendingCount: number; className?: string; } export const ComposerPendingApprovalPanel = memo(function ComposerPendingApprovalPanel({ approval, pendingCount, className, }: ComposerPendingApprovalPanelProps) { const fallbackLabel = approval.requestKind === "mcp-elicitation" ? "App access approval" : approval.requestKind === "command" ? "Command approval" : approval.requestKind === "file-read" ? "File read approval" : "File change approval"; const detailAriaLabel = approval.requestKind === "mcp-elicitation" ? "App access request" : approval.requestKind === "command" ? "Command" : approval.requestKind === "file-read" ? "File to read" : "File change"; return ( {approval.appName ? ( {approval.appName} ) : null} {approval.detail || fallbackLabel} {pendingCount > 1 ? ( 1/{pendingCount} ) : null} ); });