import { AlertCircle } from 'lucide-react'; import { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '@/components/ui/alert-dialog'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { ValidationError } from '@/lib/entityValidationSchemas'; interface ValidationBlockerDialogProps { open: boolean; onClose: () => void; blockingErrors: ValidationError[]; itemNames: string[]; } export function ValidationBlockerDialog({ open, onClose, blockingErrors, itemNames, }: ValidationBlockerDialogProps) { return ( Cannot Approve: Validation Errors The following items have blocking validation errors that MUST be fixed before approval. These items cannot be approved until the errors are resolved. Please edit or reject them.
{itemNames.map((name, index) => (
{name}
{blockingErrors .filter((_, i) => i === index || itemNames.length === 1) .map((error, errIndex) => (
{error.field}: {error.message}
))}
))}
Close
); }