55 lines · 1.4 KB · TypeScript
RawDownload
import { type ApprovalRequestId, type ProviderApprovalDecision } from "@t3tools/contracts";import { memo } from "react";import { Button } from "../ui/button"; interface ComposerPendingApprovalActionsProps {  requestId: ApprovalRequestId;  isResponding: boolean;  onRespondToApproval: (    requestId: ApprovalRequestId,    decision: ProviderApprovalDecision,  ) => Promise<unknown>;} export const ComposerPendingApprovalActions = memo(function ComposerPendingApprovalActions({  requestId,  isResponding,  onRespondToApproval,}: ComposerPendingApprovalActionsProps) {  return (    <>      <Button        size="sm"        variant="ghost"        disabled={isResponding}        onClick={() => void onRespondToApproval(requestId, "cancel")}      >        Cancel turn      </Button>      <Button        size="sm"        variant="destructive-outline"        disabled={isResponding}        onClick={() => void onRespondToApproval(requestId, "decline")}      >        Decline      </Button>      <Button        size="sm"        variant="outline"        disabled={isResponding}        onClick={() => void onRespondToApproval(requestId, "acceptForSession")}      >        Always allow this session      </Button>      <Button        size="sm"        variant="default"        disabled={isResponding}        onClick={() => void onRespondToApproval(requestId, "accept")}      >        Approve once      </Button>    </>  );});

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t