Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ComposerPendingApprovalPanel.tsx

31 lines1021 Bytes

1import { memo } from "react";
2import { type PendingApproval } from "../../session-logic";
3​
4interface ComposerPendingApprovalPanelProps {
5 approval: PendingApproval;
6 pendingCount: number;
7}
8​
9export const ComposerPendingApprovalPanel = memo(function ComposerPendingApprovalPanel({
10 approval,
11 pendingCount,
12}: ComposerPendingApprovalPanelProps) {
13 const approvalSummary =
14 approval.requestKind === "command"
15 ? "Command approval requested"
16 : approval.requestKind === "file-read"
17 ? "File-read approval requested"
18 : "File-change approval requested";
19​
20 return (
21 <div className="px-4 py-3.5 sm:px-5 sm:py-4">
22 <div className="flex flex-wrap items-center gap-2">
23 <span className="uppercase text-sm tracking-[0.2em]">PENDING APPROVAL</span>
24 <span className="text-sm font-medium">{approvalSummary}</span>
25 {pendingCount > 1 ? (
26 <span className="text-xs text-muted-foreground">1/{pendingCount}</span>
27 ) : null}
28 </div>
29 </div>
30 );
31});