import { CalendarCheck2, ImageIcon, MapPin, Smartphone } from 'lucide-react'; import DetectionLocationMap from '@/components/map/detectionLocationMap'; import { Badge } from '@/components/ui/badge'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import AnnotatedDetectionImage from '@/components/video/annotatedDetectionImage'; import { cn } from '@/lib/utils'; import type { DetectionResultItem } from '@/types'; import { formatDate } from '@/utils/date'; import { RepairProofGallery } from '../../components/repair/RepairProofGallery'; import { formatVideoTimestamp, type IssueReviewStatus } from './reviewTypes'; const REVIEW_STATUS_LABEL: Record = { not_submitted: 'Awaiting Repair', pending: 'Under Review', approved: 'Approved', rejected: 'Rejected', }; const REVIEW_STATUS_CLASS: Record = { not_submitted: 'bg-zinc-500/10 text-zinc-600 dark:text-zinc-300', pending: 'bg-violet-500/10 text-violet-600 dark:text-violet-400', approved: 'bg-emerald-500/10 text-emerald-600 dark:text-emerald-400', rejected: 'bg-destructive/10 text-destructive', }; function MetadataItem({ label, value, }: { label: string; value: React.ReactNode; }) { return (

{label}

{value}
); } interface IssueEvidencePanelProps { detection: DetectionResultItem; issueNumber: number; videoWidth: number; videoHeight: number; reviewStatus: IssueReviewStatus; } export function IssueEvidencePanel({ detection, issueNumber, videoWidth, videoHeight, reviewStatus, }: IssueEvidencePanelProps) { const repairProof = detection.repair_proof; const displayName = detection.detection.display_name; const confidence = Math.round(detection.detection.confidence * 100); return (
{displayName} #{issueNumber} {REVIEW_STATUS_LABEL[reviewStatus]}

Detection Image (Before)

Detection Location

Repair Proof (After Repair)

{repairProof?.submitted ? ( Uploaded from App ) : null}
{!repairProof?.submitted ? (

Repair proof is not submitted yet.

This issue cannot be reviewed until repair evidence is available.

) : ( <> {repairProof.submitted_at ? (

Uploaded from the field app on{' '} {formatDate(repairProof.submitted_at)}

) : null}

Repair Notes

{repairProof.notes?.trim() || 'No repair notes were provided.'}

)}
); }