import { useRef, useState } from 'react'; import { MapView } from '@common/components/map/MapView'; import type { OilReportPayload } from '@common/hooks/useSubMenu'; interface OilSpreadMapPanelProps { mapData: OilReportPayload['mapData']; capturedStep3: string | null; capturedStep6: string | null; onCaptureStep3: (dataUrl: string) => void; onCaptureStep6: (dataUrl: string) => void; onResetStep3: () => void; onResetStep6: () => void; } interface MapSlotProps { label: string; step: number; mapData: NonNullable; captured: string | null; onCapture: (dataUrl: string) => void; onReset: () => void; } const MapSlot = ({ label, step, mapData, captured, onCapture, onReset }: MapSlotProps) => { const captureRef = useRef<(() => Promise) | null>(null); const [isCapturing, setIsCapturing] = useState(false); const handleCapture = async () => { if (!captureRef.current) return; setIsCapturing(true); const dataUrl = await captureRef.current(); setIsCapturing(false); if (dataUrl) onCapture(dataUrl); }; return (
{/* 라벨 */}
{label}
{/* 지도 + 캡처 오버레이 */}
{captured && (
{`${label}
📷 캡처 완료
)}
{/* 캡처 버튼 */}

{captured ? 'PDF 출력 시 포함됩니다.' : '원하는 범위를 선택 후 캡처하세요.'}

); }; const OilSpreadMapPanel = ({ mapData, capturedStep3, capturedStep6, onCaptureStep3, onCaptureStep6, onResetStep3, onResetStep6, }: OilSpreadMapPanelProps) => { if (!mapData) { return (
확산 예측 데이터가 없습니다. 예측 탭에서 시뮬레이션을 실행 후 보고서를 생성하세요.
); } return (
); }; export default OilSpreadMapPanel;