import { Modal, ModalHeader, ModalBody, ModalFooter, } from '@/components/ui/modal'; import { Button } from '@/components/ui/button'; import { SeverityChip } from '@/components/VulnerabilityScanSheet'; import { formatTimeAgo } from '@/lib/relativeTime'; import type { PreDeployScanImage } from '@/types/security'; interface PreDeployScanDialogProps { open: boolean; stackName: string; images: PreDeployScanImage[]; onCancel: () => void; onDeploy: () => void; } /** * Advisory pre-deploy review. Shows the latest cached scan for each image in a * manual deploy so the operator can review the security posture before * proceeding. Unlike PolicyBlockDialog this never blocks: anyone can deploy or * cancel, and there is no override gate (blocking is the paid deploy-block * policy). Opened opt-in via the pre-deploy scan advisory setting. */ export function PreDeployScanDialog({ open, stackName, images, onCancel, onDeploy }: PreDeployScanDialogProps) { return ( { if (!next) onCancel(); }} size="xl">
{images.length === 0 ? (
No images found for this stack.
) : ( images.map((img) => (
{img.imageRef}
{img.scan ? `${img.scan.criticalCount} critical · ${img.scan.highCount} high · ${img.scan.mediumCount} medium · ${img.scan.lowCount} low · scanned ${formatTimeAgo(img.scan.scannedAt)}` : 'not scanned'}
{img.scan?.highestSeverity ? ( ) : null}
)) )}
Cancel } primary={ } />
); }