'use client'; import { Modal, StatusBadge, DataTable } from '@/components/ui'; interface Props { isOpen: boolean; onClose: () => void; audit: any; onComplete?: () => void; } export default function AuditCardModal({ isOpen, onClose, audit, onComplete }: Props) { if (!audit) return null; const responses = audit.responses || []; return ( {audit.status === 'in_progress' && onComplete && } }>
ВС: {audit.aircraft_id?.slice(0, 8) || '—'}
Шаблон: {audit.template_id?.slice(0, 8) || '—'}
{audit.planned_at &&
План: {new Date(audit.planned_at).toLocaleDateString('ru-RU')}
} {audit.completed_at &&
Завершён: {new Date(audit.completed_at).toLocaleDateString('ru-RU')}
}
{responses.length > 0 && (

Ответы ({responses.length})

{responses.map((r: any, i: number) => (
{r.response === 'compliant' ? '✓' : r.response === 'non_compliant' ? '✗' : '?'} {r.item_text || r.item_code || `Пункт ${i + 1}`} {r.note && {r.note}}
))}
)} {audit.findings && audit.findings.length > 0 && (

Несоответствия ({audit.findings.length})

{audit.findings.map((f: any, i: number) => (
{f.description || f.text || `Несоответствие ${i + 1}`}
))}
)}
); }