import { useState } from 'react' import type { LeftPanelProps, ExpandedSections } from './leftPanelTypes' import PredictionInputSection from './PredictionInputSection' import InfoLayerSection from './InfoLayerSection' import OilBoomSection from './OilBoomSection' export type { LeftPanelProps } export function LeftPanel({ selectedAnalysis, enabledLayers, onToggleLayer, accidentTime, onAccidentTimeChange, incidentCoord, onCoordChange, isSelectingLocation, onMapSelectClick, onRunSimulation, isRunningSimulation, selectedModels, onModelsChange, predictionTime, onPredictionTimeChange, spillType, onSpillTypeChange, oilType, onOilTypeChange, spillAmount, onSpillAmountChange, incidentName, onIncidentNameChange, spillUnit, onSpillUnitChange, boomLines, onBoomLinesChange, oilTrajectory, algorithmSettings, onAlgorithmSettingsChange, isDrawingBoom, onDrawingBoomChange, drawingPoints, onDrawingPointsChange, containmentResult, onContainmentResultChange, layerOpacity, onLayerOpacityChange, layerBrightness, onLayerBrightnessChange, onImageAnalysisResult, }: LeftPanelProps) { const [expandedSections, setExpandedSections] = useState({ predictionInput: true, incident: false, impactResources: false, infoLayer: true, oilBoom: false, }) const toggleSection = (section: keyof ExpandedSections) => { setExpandedSections(prev => ({ ...prev, [section]: !prev[section] })) } return (
{/* Scrollable Content */}
{/* Prediction Input Section */} toggleSection('predictionInput')} accidentTime={accidentTime} onAccidentTimeChange={onAccidentTimeChange} incidentCoord={incidentCoord} onCoordChange={onCoordChange} isSelectingLocation={isSelectingLocation} onMapSelectClick={onMapSelectClick} onRunSimulation={onRunSimulation} isRunningSimulation={isRunningSimulation} selectedModels={selectedModels} onModelsChange={onModelsChange} predictionTime={predictionTime} onPredictionTimeChange={onPredictionTimeChange} spillType={spillType} onSpillTypeChange={onSpillTypeChange} oilType={oilType} onOilTypeChange={onOilTypeChange} spillAmount={spillAmount} onSpillAmountChange={onSpillAmountChange} incidentName={incidentName} onIncidentNameChange={onIncidentNameChange} spillUnit={spillUnit} onSpillUnitChange={onSpillUnitChange} onImageAnalysisResult={onImageAnalysisResult} /> {/* Incident Section */}
toggleSection('incident')} className="flex items-center justify-between p-4 cursor-pointer hover:bg-[rgba(255,255,255,0.02)]" >

사고정보

{expandedSections.incident ? '▼' : '▶'}
{expandedSections.incident && (
{/* Status Badge */}
진행중
{/* Info Grid */}
사고코드 {selectedAnalysis ? `INC-2025-${String(selectedAnalysis.id).padStart(4, '0')}` : 'INC-2025-0042'}
사고명 {selectedAnalysis?.name || '씨프린스호'}
사고일시 {selectedAnalysis?.occurredAt || '2025-02-10 06:30'}
유종 {selectedAnalysis?.oilType || 'BUNKER_C'}
유출량 {selectedAnalysis ? `${selectedAnalysis.volume.toFixed(2)} kl` : '350.00 kl'}
담당자 {selectedAnalysis?.analyst || '남해청, 방재과'}
위치 {selectedAnalysis?.location || '여수 돌산 남방 5NM'}
)}
{/* Impact Resources Section */}
toggleSection('impactResources')} className="flex items-center justify-between p-4 cursor-pointer hover:bg-[rgba(255,255,255,0.02)]" >

영향 민감자원

{expandedSections.impactResources ? '▼' : '▶'}
{expandedSections.impactResources && (

영향받는 민감자원 목록

)}
{/* Info Layer Section */} toggleSection('infoLayer')} enabledLayers={enabledLayers} onToggleLayer={onToggleLayer} layerOpacity={layerOpacity} onLayerOpacityChange={onLayerOpacityChange} layerBrightness={layerBrightness} onLayerBrightnessChange={onLayerBrightnessChange} /> {/* Oil Boom Placement Guide Section */} toggleSection('oilBoom')} boomLines={boomLines} onBoomLinesChange={onBoomLinesChange} oilTrajectory={oilTrajectory} incidentCoord={incidentCoord ?? { lat: 0, lon: 0 }} algorithmSettings={algorithmSettings} onAlgorithmSettingsChange={onAlgorithmSettingsChange} isDrawingBoom={isDrawingBoom} onDrawingBoomChange={onDrawingBoomChange} drawingPoints={drawingPoints} onDrawingPointsChange={onDrawingPointsChange} containmentResult={containmentResult} onContainmentResultChange={onContainmentResultChange} />
) }