import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { toast } from "@/components/ui/use-toast"; import { copyText } from "@/util/copyText"; import { generateApiCommands, type ApiCommandOptions, } from "@/util/apiCommands"; type ApiWebhookActionsMenuProps = { getOptions: () => ApiCommandOptions; runId?: string; webhookDisabled?: boolean; onTestWebhook: () => void; }; export function ApiWebhookActionsMenu({ getOptions, webhookDisabled = false, onTestWebhook, }: ApiWebhookActionsMenuProps) { return ( Re-run via API { const { curl } = generateApiCommands(getOptions()); copyText(curl).then(() => { toast({ variant: "success", title: "Copied to Clipboard", description: "The cURL command has been copied to your clipboard.", }); }); }} > Copy cURL (Unix/Linux/macOS) { const { powershell } = generateApiCommands(getOptions()); copyText(powershell).then(() => { toast({ variant: "success", title: "Copied to Clipboard", description: "The PowerShell command has been copied to your clipboard.", }); }); }} > Copy PowerShell (Windows) Webhooks { setTimeout(() => onTestWebhook(), 0); }} > Test Webhook ); }