import React from 'react'; import { Form } from "@remix-run/react"; interface ReportFormModalProps { isOpen: boolean; onClose: () => void; isEditing: boolean; isSubmitting: boolean; editingReport: any; actionData: any; areas: any[]; dredgerLocations: any[]; reclamationLocations: any[]; foremen: any[]; equipment: any[]; timeSheetEntries: any[]; stoppageEntries: any[]; addTimeSheetEntry: () => void; removeTimeSheetEntry: (id: string) => void; updateTimeSheetEntry: (id: string, field: string, value: string) => void; addStoppageEntry: () => void; removeStoppageEntry: (id: string) => void; updateStoppageEntry: (id: string, field: string, value: string) => void; } export default function ReportFormModal({ isOpen, onClose, isEditing, isSubmitting, editingReport, actionData, areas, dredgerLocations, reclamationLocations, foremen, equipment, timeSheetEntries, stoppageEntries, addTimeSheetEntry, removeTimeSheetEntry, updateTimeSheetEntry, addStoppageEntry, removeStoppageEntry, updateStoppageEntry }: ReportFormModalProps) { if (!isOpen) return null; return (

{isEditing ? "Edit Report" : "Create New Report"}

{/* Enhanced Modal Footer */}
); } // Basic Information Component function BasicInformation({ editingReport, actionData, areas, dredgerLocations, reclamationLocations }: any) { return (

Basic Information

{actionData?.errors?.shift && (

{actionData.errors.shift}

)}
{actionData?.errors?.areaId && (

{actionData.errors.areaId}

)}
{actionData?.errors?.dredgerLocationId && (

{actionData.errors.dredgerLocationId}

)}
{actionData?.errors?.reclamationLocationId && (

{actionData.errors.reclamationLocationId}

)}
{actionData?.errors?.dredgerLineLength && (

{actionData.errors.dredgerLineLength}

)}
{actionData?.errors?.shoreConnection && (

{actionData.errors.shoreConnection}

)}
); } // Reclamation Height Component function ReclamationHeight({ editingReport }: any) { return (

Reclamation Height

); } // Pipeline Length Component function PipelineLength({ editingReport }: any) { return (

Pipeline Length

); } // Equipment Statistics Component function EquipmentStatistics({ editingReport, foremen }: any) { return (

Equipment Statistics

); } // TimeSheet Section Component function TimeSheetSection({ timeSheetEntries, equipment, addTimeSheetEntry, removeTimeSheetEntry, updateTimeSheetEntry }: any) { return (

Equipments Time Sheet

Track Equipment working hours and maintenance periods

{timeSheetEntries.length === 0 ? (

No Equipment entries yet

Click "Add Equipment Entry" to start tracking Equipment hours

) : (
{timeSheetEntries.map((entry: any, index: number) => (
Entry #{index + 1}
updateTimeSheetEntry(entry.id, 'reason', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 text-sm" placeholder="e.g., Maintenance, Operation" />
updateTimeSheetEntry(entry.id, 'from1', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 text-sm" />
updateTimeSheetEntry(entry.id, 'to1', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 text-sm" />
updateTimeSheetEntry(entry.id, 'from2', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 text-sm" />
updateTimeSheetEntry(entry.id, 'to2', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-blue-500 focus:border-blue-500 text-sm" />
{entry.total}
))}
)}
); } // Stoppages Section Component function StoppagesSection({ stoppageEntries, addStoppageEntry, removeStoppageEntry, updateStoppageEntry }: any) { return (

Operation Stoppages

Record operational interruptions and downtime

{stoppageEntries.length === 0 ? (

No stoppages recorded

Click "Add Stoppage" to record operational interruptions

) : (
{stoppageEntries.map((entry: any, index: number) => (
Stoppage #{index + 1}
updateStoppageEntry(entry.id, 'from', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-red-500 focus:border-red-500 text-sm" />
updateStoppageEntry(entry.id, 'to', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-red-500 focus:border-red-500 text-sm" />
{entry.total}
updateStoppageEntry(entry.id, 'reason', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-red-500 focus:border-red-500 text-sm" placeholder="e.g., Maintenance, Equipment failure" />
updateStoppageEntry(entry.id, 'responsible', e.target.value)} className="block w-full border-gray-300 rounded-md shadow-sm focus:ring-red-500 focus:border-red-500 text-sm" placeholder="e.g., Maintenance team" />