import { reviewDeployment } from "~/fns/deployments"; import { useAction } from "~/hooks/use-action"; import { Button } from "~/components/ui/Button"; import { ErrorBanner } from "~/components/ui/Field"; type PendingDeployment = { id: string; environment: string; waitUntil: number | null; needsReview: boolean; canReview: boolean; }; /** Banner for jobs held by environment protection rules, with approve/reject for required reviewers. */ export function DeploymentGate({ owner, repo, deployments, }: { owner: string; repo: string; deployments: PendingDeployment[]; }) { const review = useAction(reviewDeployment); if (deployments.length === 0) return null; return (