From f099ff29b124e6a9d85ba368a72a2f47bde3b716 Mon Sep 17 00:00:00 2001 From: htlee Date: Sat, 28 Feb 2026 14:08:34 +0900 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=ED=83=AD=20=EB=8B=A8?= =?UTF-8?q?=EC=9C=84=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EA=B5=AC=EC=A1=B0=20?= =?UTF-8?q?=EC=A0=84=ED=99=98=20(tabs/)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 11개 탭 디렉토리 생성: tabs/{prediction,hns,rescue,weather,incidents,aerial,board,reports,assets,scat,admin}/ - 51개 컴포넌트를 역할 기반(views/, analysis/, layout/) → 탭 기반(tabs/) 구조로 이동 - weather 탭에 전용 hooks/, services/ 포함 - incidents 탭에 전용 services/ 포함 - 공통 지도 컴포넌트(MapView, BacktrackReplay)를 common/components/map/으로 이동 - 각 탭에 index.ts 생성하여 View 컴포넌트 re-export - App.tsx import를 @tabs/ alias 사용으로 변경 - 전체 import 경로 수정 (탭 내부 상대경로, 외부 @common/ alias) Co-Authored-By: Claude Opus 4.6 --- frontend/src/App.tsx | 22 +++++++++---------- .../components/map/BacktrackReplayBar.tsx | 0 .../components/map/BacktrackReplayOverlay.tsx | 0 .../{ => common}/components/map/MapView.tsx | 4 ++-- .../admin/components}/AdminView.tsx | 0 frontend/src/tabs/admin/index.ts | 1 + .../aerial/components}/AerialTheoryView.tsx | 0 .../aerial/components}/AerialView.tsx | 2 +- frontend/src/tabs/aerial/index.ts | 1 + .../assets/components}/AssetsView.tsx | 0 frontend/src/tabs/assets/index.ts | 1 + .../board/components}/BoardDetailView.tsx | 0 .../board/components}/BoardListTable.tsx | 0 .../board/components}/BoardView.tsx | 4 ++-- .../board/components}/BoardWriteForm.tsx | 0 frontend/src/tabs/board/index.ts | 1 + .../hns/components}/HNSAnalysisListTable.tsx | 0 .../hns/components}/HNSLeftPanel.tsx | 0 .../hns/components}/HNSRecalcModal.tsx | 0 .../hns/components}/HNSRightPanel.tsx | 0 .../hns/components}/HNSScenarioView.tsx | 0 .../hns/components}/HNSSubstanceView.tsx | 2 +- .../hns/components}/HNSTheoryView.tsx | 0 .../views => tabs/hns/components}/HNSView.tsx | 16 +++++++------- frontend/src/tabs/hns/index.ts | 1 + .../incidents/components}/IncidentTable.tsx | 0 .../components}/IncidentsLeftPanel.tsx | 0 .../components}/IncidentsRightPanel.tsx | 0 .../incidents/components}/IncidentsView.tsx | 6 ++--- .../incidents/components}/MediaModal.tsx | 0 frontend/src/tabs/incidents/index.ts | 1 + .../incidents}/services/vesselService.ts | 0 .../components}/AnalysisListTable.tsx | 0 .../prediction/components}/BacktrackModal.tsx | 0 .../components}/BoomDeploymentTheoryView.tsx | 0 .../prediction/components}/LeftPanel.tsx | 12 +++++----- .../components}/OilSpillTheoryView.tsx | 0 .../prediction/components}/OilSpillView.tsx | 20 ++++++++--------- .../prediction/components}/RecalcModal.tsx | 2 +- .../prediction/components}/RightPanel.tsx | 0 frontend/src/tabs/prediction/index.ts | 1 + .../components}/OilSpillReportTemplate.tsx | 0 .../reports/components}/ReportsView.tsx | 2 +- frontend/src/tabs/reports/index.ts | 1 + .../rescue/components}/RescueScenarioView.tsx | 0 .../rescue/components}/RescueTheoryView.tsx | 0 .../rescue/components}/RescueView.tsx | 4 ++-- frontend/src/tabs/rescue/index.ts | 1 + .../scat/components}/PreScatView.tsx | 0 .../weather/components}/OceanCurrentLayer.tsx | 0 .../components}/OceanForecastOverlay.tsx | 2 +- .../components}/WaterTemperatureLayer.tsx | 0 .../weather/components}/WeatherMapOverlay.tsx | 0 .../weather/components}/WeatherRightPanel.tsx | 0 .../weather/components}/WeatherView.tsx | 16 +++++++------- .../weather/components}/WindParticleLayer.tsx | 0 .../weather}/hooks/useOceanForecast.ts | 0 .../weather}/hooks/useWeatherData.ts | 0 frontend/src/tabs/weather/index.ts | 1 + .../{ => tabs/weather}/services/khoaApi.ts | 0 .../{ => tabs/weather}/services/weatherApi.ts | 0 .../weather}/services/weatherService.ts | 0 62 files changed, 67 insertions(+), 57 deletions(-) rename frontend/src/{ => common}/components/map/BacktrackReplayBar.tsx (100%) rename frontend/src/{ => common}/components/map/BacktrackReplayOverlay.tsx (100%) rename frontend/src/{ => common}/components/map/MapView.tsx (99%) rename frontend/src/{components/views => tabs/admin/components}/AdminView.tsx (100%) create mode 100644 frontend/src/tabs/admin/index.ts rename frontend/src/{components/analysis => tabs/aerial/components}/AerialTheoryView.tsx (100%) rename frontend/src/{components/views => tabs/aerial/components}/AerialView.tsx (99%) create mode 100644 frontend/src/tabs/aerial/index.ts rename frontend/src/{components/views => tabs/assets/components}/AssetsView.tsx (100%) create mode 100644 frontend/src/tabs/assets/index.ts rename frontend/src/{components/board => tabs/board/components}/BoardDetailView.tsx (100%) rename frontend/src/{components/board => tabs/board/components}/BoardListTable.tsx (100%) rename frontend/src/{components/views => tabs/board/components}/BoardView.tsx (99%) rename frontend/src/{components/board => tabs/board/components}/BoardWriteForm.tsx (100%) create mode 100644 frontend/src/tabs/board/index.ts rename frontend/src/{components/analysis => tabs/hns/components}/HNSAnalysisListTable.tsx (100%) rename frontend/src/{components/layout => tabs/hns/components}/HNSLeftPanel.tsx (100%) rename frontend/src/{components/analysis => tabs/hns/components}/HNSRecalcModal.tsx (100%) rename frontend/src/{components/layout => tabs/hns/components}/HNSRightPanel.tsx (100%) rename frontend/src/{components/analysis => tabs/hns/components}/HNSScenarioView.tsx (100%) rename frontend/src/{components/analysis => tabs/hns/components}/HNSSubstanceView.tsx (99%) rename frontend/src/{components/analysis => tabs/hns/components}/HNSTheoryView.tsx (100%) rename frontend/src/{components/views => tabs/hns/components}/HNSView.tsx (98%) create mode 100644 frontend/src/tabs/hns/index.ts rename frontend/src/{components/incidents => tabs/incidents/components}/IncidentTable.tsx (100%) rename frontend/src/{components/incidents => tabs/incidents/components}/IncidentsLeftPanel.tsx (100%) rename frontend/src/{components/incidents => tabs/incidents/components}/IncidentsRightPanel.tsx (100%) rename frontend/src/{components/views => tabs/incidents/components}/IncidentsView.tsx (99%) rename frontend/src/{components/incidents => tabs/incidents/components}/MediaModal.tsx (100%) create mode 100644 frontend/src/tabs/incidents/index.ts rename frontend/src/{ => tabs/incidents}/services/vesselService.ts (100%) rename frontend/src/{components/analysis => tabs/prediction/components}/AnalysisListTable.tsx (100%) rename frontend/src/{components/analysis => tabs/prediction/components}/BacktrackModal.tsx (100%) rename frontend/src/{components/analysis => tabs/prediction/components}/BoomDeploymentTheoryView.tsx (100%) rename frontend/src/{components/layout => tabs/prediction/components}/LeftPanel.tsx (99%) rename frontend/src/{components/analysis => tabs/prediction/components}/OilSpillTheoryView.tsx (100%) rename frontend/src/{components/views => tabs/prediction/components}/OilSpillView.tsx (97%) rename frontend/src/{components/analysis => tabs/prediction/components}/RecalcModal.tsx (99%) rename frontend/src/{components/layout => tabs/prediction/components}/RightPanel.tsx (100%) create mode 100644 frontend/src/tabs/prediction/index.ts rename frontend/src/{components/reports => tabs/reports/components}/OilSpillReportTemplate.tsx (100%) rename frontend/src/{components/views => tabs/reports/components}/ReportsView.tsx (99%) create mode 100644 frontend/src/tabs/reports/index.ts rename frontend/src/{components/analysis => tabs/rescue/components}/RescueScenarioView.tsx (100%) rename frontend/src/{components/analysis => tabs/rescue/components}/RescueTheoryView.tsx (100%) rename frontend/src/{components/views => tabs/rescue/components}/RescueView.tsx (99%) create mode 100644 frontend/src/tabs/rescue/index.ts rename frontend/src/{components/views => tabs/scat/components}/PreScatView.tsx (100%) rename frontend/src/{components/weather => tabs/weather/components}/OceanCurrentLayer.tsx (100%) rename frontend/src/{components/weather => tabs/weather/components}/OceanForecastOverlay.tsx (95%) rename frontend/src/{components/weather => tabs/weather/components}/WaterTemperatureLayer.tsx (100%) rename frontend/src/{components/weather => tabs/weather/components}/WeatherMapOverlay.tsx (100%) rename frontend/src/{components/weather => tabs/weather/components}/WeatherRightPanel.tsx (100%) rename frontend/src/{components/views => tabs/weather/components}/WeatherView.tsx (97%) rename frontend/src/{components/weather => tabs/weather/components}/WindParticleLayer.tsx (100%) rename frontend/src/{ => tabs/weather}/hooks/useOceanForecast.ts (100%) rename frontend/src/{ => tabs/weather}/hooks/useWeatherData.ts (100%) create mode 100644 frontend/src/tabs/weather/index.ts rename frontend/src/{ => tabs/weather}/services/khoaApi.ts (100%) rename frontend/src/{ => tabs/weather}/services/weatherApi.ts (100%) rename frontend/src/{ => tabs/weather}/services/weatherService.ts (100%) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 3805afc..bc5b47b 100755 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -6,17 +6,17 @@ import { LoginPage } from '@common/components/auth/LoginPage' import { registerMainTabSwitcher } from '@common/hooks/useSubMenu' import { useAuthStore } from '@common/store/authStore' import { useMenuStore } from '@common/store/menuStore' -import { OilSpillView } from './components/views/OilSpillView' -import { ReportsView } from './components/views/ReportsView' -import { HNSView } from './components/views/HNSView' -import { AerialView } from './components/views/AerialView' -import { AssetsView } from './components/views/AssetsView' -import { BoardView } from './components/views/BoardView' -import { WeatherView } from './components/views/WeatherView' -import { IncidentsView } from './components/views/IncidentsView' -import { AdminView } from './components/views/AdminView' -import { PreScatView } from './components/views/PreScatView' -import { RescueView } from './components/views/RescueView' +import { OilSpillView } from '@tabs/prediction' +import { ReportsView } from '@tabs/reports' +import { HNSView } from '@tabs/hns' +import { AerialView } from '@tabs/aerial' +import { AssetsView } from '@tabs/assets' +import { BoardView } from '@tabs/board' +import { WeatherView } from '@tabs/weather' +import { IncidentsView } from '@tabs/incidents' +import { AdminView } from '@tabs/admin' +import { PreScatView } from '@tabs/scat' +import { RescueView } from '@tabs/rescue' const GOOGLE_CLIENT_ID = import.meta.env.VITE_GOOGLE_CLIENT_ID || '' diff --git a/frontend/src/components/map/BacktrackReplayBar.tsx b/frontend/src/common/components/map/BacktrackReplayBar.tsx similarity index 100% rename from frontend/src/components/map/BacktrackReplayBar.tsx rename to frontend/src/common/components/map/BacktrackReplayBar.tsx diff --git a/frontend/src/components/map/BacktrackReplayOverlay.tsx b/frontend/src/common/components/map/BacktrackReplayOverlay.tsx similarity index 100% rename from frontend/src/components/map/BacktrackReplayOverlay.tsx rename to frontend/src/common/components/map/BacktrackReplayOverlay.tsx diff --git a/frontend/src/components/map/MapView.tsx b/frontend/src/common/components/map/MapView.tsx similarity index 99% rename from frontend/src/components/map/MapView.tsx rename to frontend/src/common/components/map/MapView.tsx index 6fc8738..47c075a 100755 --- a/frontend/src/components/map/MapView.tsx +++ b/frontend/src/common/components/map/MapView.tsx @@ -2,9 +2,9 @@ import { useState, useMemo, useEffect } from 'react' import { MapContainer, TileLayer, Marker, Popup, useMap, useMapEvents, CircleMarker, Circle, Polyline } from 'react-leaflet' import 'leaflet/dist/leaflet.css' import L from 'leaflet' -import { layerDatabase } from '../../data/layerDatabase' +import { layerDatabase } from '../../../data/layerDatabase' import { decimalToDMS } from '@common/utils/coordinates' -import type { PredictionModel } from '../views/OilSpillView' +import type { PredictionModel } from '@tabs/prediction/components/OilSpillView' import type { BoomLine, BoomLineCoord } from '@common/types/boomLine' import type { ReplayShip, CollisionEvent } from '@common/types/backtrack' import { BacktrackReplayOverlay } from './BacktrackReplayOverlay' diff --git a/frontend/src/components/views/AdminView.tsx b/frontend/src/tabs/admin/components/AdminView.tsx similarity index 100% rename from frontend/src/components/views/AdminView.tsx rename to frontend/src/tabs/admin/components/AdminView.tsx diff --git a/frontend/src/tabs/admin/index.ts b/frontend/src/tabs/admin/index.ts new file mode 100644 index 0000000..a4a410b --- /dev/null +++ b/frontend/src/tabs/admin/index.ts @@ -0,0 +1 @@ +export { AdminView } from './components/AdminView' diff --git a/frontend/src/components/analysis/AerialTheoryView.tsx b/frontend/src/tabs/aerial/components/AerialTheoryView.tsx similarity index 100% rename from frontend/src/components/analysis/AerialTheoryView.tsx rename to frontend/src/tabs/aerial/components/AerialTheoryView.tsx diff --git a/frontend/src/components/views/AerialView.tsx b/frontend/src/tabs/aerial/components/AerialView.tsx similarity index 99% rename from frontend/src/components/views/AerialView.tsx rename to frontend/src/tabs/aerial/components/AerialView.tsx index 0ecfbaf..321850f 100755 --- a/frontend/src/components/views/AerialView.tsx +++ b/frontend/src/tabs/aerial/components/AerialView.tsx @@ -1,6 +1,6 @@ import { useState, useRef, useEffect } from 'react' import { useSubMenu } from '@common/hooks/useSubMenu' -import { AerialTheoryView } from '../analysis/AerialTheoryView' +import { AerialTheoryView } from './AerialTheoryView' type AerialTab = 'media' | 'analysis' | 'realtime' | 'sensor' diff --git a/frontend/src/tabs/aerial/index.ts b/frontend/src/tabs/aerial/index.ts new file mode 100644 index 0000000..013f9e4 --- /dev/null +++ b/frontend/src/tabs/aerial/index.ts @@ -0,0 +1 @@ +export { AerialView } from './components/AerialView' diff --git a/frontend/src/components/views/AssetsView.tsx b/frontend/src/tabs/assets/components/AssetsView.tsx similarity index 100% rename from frontend/src/components/views/AssetsView.tsx rename to frontend/src/tabs/assets/components/AssetsView.tsx diff --git a/frontend/src/tabs/assets/index.ts b/frontend/src/tabs/assets/index.ts new file mode 100644 index 0000000..2b2f64f --- /dev/null +++ b/frontend/src/tabs/assets/index.ts @@ -0,0 +1 @@ +export { AssetsView } from './components/AssetsView' diff --git a/frontend/src/components/board/BoardDetailView.tsx b/frontend/src/tabs/board/components/BoardDetailView.tsx similarity index 100% rename from frontend/src/components/board/BoardDetailView.tsx rename to frontend/src/tabs/board/components/BoardDetailView.tsx diff --git a/frontend/src/components/board/BoardListTable.tsx b/frontend/src/tabs/board/components/BoardListTable.tsx similarity index 100% rename from frontend/src/components/board/BoardListTable.tsx rename to frontend/src/tabs/board/components/BoardListTable.tsx diff --git a/frontend/src/components/views/BoardView.tsx b/frontend/src/tabs/board/components/BoardView.tsx similarity index 99% rename from frontend/src/components/views/BoardView.tsx rename to frontend/src/tabs/board/components/BoardView.tsx index 9258ffd..d9a996e 100755 --- a/frontend/src/components/views/BoardView.tsx +++ b/frontend/src/tabs/board/components/BoardView.tsx @@ -1,7 +1,7 @@ import { useState } from 'react' import { useSubMenu } from '@common/hooks/useSubMenu' -import { BoardWriteForm } from '../board/BoardWriteForm' -import { BoardDetailView } from '../board/BoardDetailView' +import { BoardWriteForm } from './BoardWriteForm' +import { BoardDetailView } from './BoardDetailView' interface BoardPost { id: number diff --git a/frontend/src/components/board/BoardWriteForm.tsx b/frontend/src/tabs/board/components/BoardWriteForm.tsx similarity index 100% rename from frontend/src/components/board/BoardWriteForm.tsx rename to frontend/src/tabs/board/components/BoardWriteForm.tsx diff --git a/frontend/src/tabs/board/index.ts b/frontend/src/tabs/board/index.ts new file mode 100644 index 0000000..31edec6 --- /dev/null +++ b/frontend/src/tabs/board/index.ts @@ -0,0 +1 @@ +export { BoardView } from './components/BoardView' diff --git a/frontend/src/components/analysis/HNSAnalysisListTable.tsx b/frontend/src/tabs/hns/components/HNSAnalysisListTable.tsx similarity index 100% rename from frontend/src/components/analysis/HNSAnalysisListTable.tsx rename to frontend/src/tabs/hns/components/HNSAnalysisListTable.tsx diff --git a/frontend/src/components/layout/HNSLeftPanel.tsx b/frontend/src/tabs/hns/components/HNSLeftPanel.tsx similarity index 100% rename from frontend/src/components/layout/HNSLeftPanel.tsx rename to frontend/src/tabs/hns/components/HNSLeftPanel.tsx diff --git a/frontend/src/components/analysis/HNSRecalcModal.tsx b/frontend/src/tabs/hns/components/HNSRecalcModal.tsx similarity index 100% rename from frontend/src/components/analysis/HNSRecalcModal.tsx rename to frontend/src/tabs/hns/components/HNSRecalcModal.tsx diff --git a/frontend/src/components/layout/HNSRightPanel.tsx b/frontend/src/tabs/hns/components/HNSRightPanel.tsx similarity index 100% rename from frontend/src/components/layout/HNSRightPanel.tsx rename to frontend/src/tabs/hns/components/HNSRightPanel.tsx diff --git a/frontend/src/components/analysis/HNSScenarioView.tsx b/frontend/src/tabs/hns/components/HNSScenarioView.tsx similarity index 100% rename from frontend/src/components/analysis/HNSScenarioView.tsx rename to frontend/src/tabs/hns/components/HNSScenarioView.tsx diff --git a/frontend/src/components/analysis/HNSSubstanceView.tsx b/frontend/src/tabs/hns/components/HNSSubstanceView.tsx similarity index 99% rename from frontend/src/components/analysis/HNSSubstanceView.tsx rename to frontend/src/tabs/hns/components/HNSSubstanceView.tsx index 1008239..e314597 100755 --- a/frontend/src/components/analysis/HNSSubstanceView.tsx +++ b/frontend/src/tabs/hns/components/HNSSubstanceView.tsx @@ -1,6 +1,6 @@ import React, { useState, useRef, useMemo } from 'react' import { sanitizeHtml } from '@common/utils/sanitize' -import { HNS_SEARCH_DB, type HNSSearchSubstance } from '../../data/hnsSubstanceSearchData' +import { HNS_SEARCH_DB, type HNSSearchSubstance } from '../../../data/hnsSubstanceSearchData' /* ═══ HNS 물질 데이터베이스 ═══ */ interface HNSSubstance { diff --git a/frontend/src/components/analysis/HNSTheoryView.tsx b/frontend/src/tabs/hns/components/HNSTheoryView.tsx similarity index 100% rename from frontend/src/components/analysis/HNSTheoryView.tsx rename to frontend/src/tabs/hns/components/HNSTheoryView.tsx diff --git a/frontend/src/components/views/HNSView.tsx b/frontend/src/tabs/hns/components/HNSView.tsx similarity index 98% rename from frontend/src/components/views/HNSView.tsx rename to frontend/src/tabs/hns/components/HNSView.tsx index d13ab75..572c28d 100755 --- a/frontend/src/components/views/HNSView.tsx +++ b/frontend/src/tabs/hns/components/HNSView.tsx @@ -1,12 +1,12 @@ import { useState } from 'react' -import { HNSLeftPanel } from '../layout/HNSLeftPanel' -import { HNSRightPanel } from '../layout/HNSRightPanel' -import { MapView } from '../map/MapView' -import { HNSAnalysisListTable } from '../analysis/HNSAnalysisListTable' -import { HNSTheoryView } from '../analysis/HNSTheoryView' -import { HNSSubstanceView } from '../analysis/HNSSubstanceView' -import { HNSScenarioView } from '../analysis/HNSScenarioView' -import { HNSRecalcModal } from '../analysis/HNSRecalcModal' +import { HNSLeftPanel } from './HNSLeftPanel' +import { HNSRightPanel } from './HNSRightPanel' +import { MapView } from '@common/components/map/MapView' +import { HNSAnalysisListTable } from './HNSAnalysisListTable' +import { HNSTheoryView } from './HNSTheoryView' +import { HNSSubstanceView } from './HNSSubstanceView' +import { HNSScenarioView } from './HNSScenarioView' +import { HNSRecalcModal } from './HNSRecalcModal' import { useSubMenu, navigateToTab, setReportGenCategory } from '@common/hooks/useSubMenu' /* ─── HNS 매뉴얼 뷰어 컴포넌트 ─── */ diff --git a/frontend/src/tabs/hns/index.ts b/frontend/src/tabs/hns/index.ts new file mode 100644 index 0000000..a413011 --- /dev/null +++ b/frontend/src/tabs/hns/index.ts @@ -0,0 +1 @@ +export { HNSView } from './components/HNSView' diff --git a/frontend/src/components/incidents/IncidentTable.tsx b/frontend/src/tabs/incidents/components/IncidentTable.tsx similarity index 100% rename from frontend/src/components/incidents/IncidentTable.tsx rename to frontend/src/tabs/incidents/components/IncidentTable.tsx diff --git a/frontend/src/components/incidents/IncidentsLeftPanel.tsx b/frontend/src/tabs/incidents/components/IncidentsLeftPanel.tsx similarity index 100% rename from frontend/src/components/incidents/IncidentsLeftPanel.tsx rename to frontend/src/tabs/incidents/components/IncidentsLeftPanel.tsx diff --git a/frontend/src/components/incidents/IncidentsRightPanel.tsx b/frontend/src/tabs/incidents/components/IncidentsRightPanel.tsx similarity index 100% rename from frontend/src/components/incidents/IncidentsRightPanel.tsx rename to frontend/src/tabs/incidents/components/IncidentsRightPanel.tsx diff --git a/frontend/src/components/views/IncidentsView.tsx b/frontend/src/tabs/incidents/components/IncidentsView.tsx similarity index 99% rename from frontend/src/components/views/IncidentsView.tsx rename to frontend/src/tabs/incidents/components/IncidentsView.tsx index 71fbca4..9e3ab9f 100755 --- a/frontend/src/components/views/IncidentsView.tsx +++ b/frontend/src/tabs/incidents/components/IncidentsView.tsx @@ -3,9 +3,9 @@ import { MapContainer, TileLayer, CircleMarker, Popup, Marker } from 'react-leaf import L from 'leaflet' import type { LatLngExpression } from 'leaflet' import 'leaflet/dist/leaflet.css' -import { IncidentsLeftPanel, type Incident } from '../incidents/IncidentsLeftPanel' -import { IncidentsRightPanel, type ViewMode, type AnalysisSection } from '../incidents/IncidentsRightPanel' -import { mockVessels, VESSEL_LEGEND, type Vessel } from '../../data/vesselMockData' +import { IncidentsLeftPanel, type Incident } from './IncidentsLeftPanel' +import { IncidentsRightPanel, type ViewMode, type AnalysisSection } from './IncidentsRightPanel' +import { mockVessels, VESSEL_LEGEND, type Vessel } from '../../../data/vesselMockData' // Mock incident data (HTML 참고 6건) const mockIncidents: Incident[] = [ diff --git a/frontend/src/components/incidents/MediaModal.tsx b/frontend/src/tabs/incidents/components/MediaModal.tsx similarity index 100% rename from frontend/src/components/incidents/MediaModal.tsx rename to frontend/src/tabs/incidents/components/MediaModal.tsx diff --git a/frontend/src/tabs/incidents/index.ts b/frontend/src/tabs/incidents/index.ts new file mode 100644 index 0000000..9a15c9b --- /dev/null +++ b/frontend/src/tabs/incidents/index.ts @@ -0,0 +1 @@ +export { IncidentsView } from './components/IncidentsView' diff --git a/frontend/src/services/vesselService.ts b/frontend/src/tabs/incidents/services/vesselService.ts similarity index 100% rename from frontend/src/services/vesselService.ts rename to frontend/src/tabs/incidents/services/vesselService.ts diff --git a/frontend/src/components/analysis/AnalysisListTable.tsx b/frontend/src/tabs/prediction/components/AnalysisListTable.tsx similarity index 100% rename from frontend/src/components/analysis/AnalysisListTable.tsx rename to frontend/src/tabs/prediction/components/AnalysisListTable.tsx diff --git a/frontend/src/components/analysis/BacktrackModal.tsx b/frontend/src/tabs/prediction/components/BacktrackModal.tsx similarity index 100% rename from frontend/src/components/analysis/BacktrackModal.tsx rename to frontend/src/tabs/prediction/components/BacktrackModal.tsx diff --git a/frontend/src/components/analysis/BoomDeploymentTheoryView.tsx b/frontend/src/tabs/prediction/components/BoomDeploymentTheoryView.tsx similarity index 100% rename from frontend/src/components/analysis/BoomDeploymentTheoryView.tsx rename to frontend/src/tabs/prediction/components/BoomDeploymentTheoryView.tsx diff --git a/frontend/src/components/layout/LeftPanel.tsx b/frontend/src/tabs/prediction/components/LeftPanel.tsx similarity index 99% rename from frontend/src/components/layout/LeftPanel.tsx rename to frontend/src/tabs/prediction/components/LeftPanel.tsx index 0122881..a3540a3 100755 --- a/frontend/src/components/layout/LeftPanel.tsx +++ b/frontend/src/tabs/prediction/components/LeftPanel.tsx @@ -1,16 +1,16 @@ import { useState, useMemo } from 'react' import { LayerTree } from '@common/components/layer/LayerTree' import { useLayerTree } from '@common/hooks/useLayers' -import { layerData } from '../../data/layerData' -import type { LayerNode } from '../../data/layerData' -import type { Layer } from '../../data/layerDatabase' +import { layerData } from '../../../data/layerData' +import type { LayerNode } from '../../../data/layerData' +import type { Layer } from '../../../data/layerDatabase' import { decimalToDMS } from '@common/utils/coordinates' import { ComboBox } from '@common/components/ui/ComboBox' -import { ALL_MODELS } from '../views/OilSpillView' -import type { PredictionModel } from '../views/OilSpillView' +import { ALL_MODELS } from './OilSpillView' +import type { PredictionModel } from './OilSpillView' import type { BoomLine, BoomLineCoord, AlgorithmSettings, ContainmentResult } from '@common/types/boomLine' import { generateAIBoomLines, runContainmentAnalysis, computePolylineLength, computeBearing } from '@common/utils/geo' -import type { Analysis } from '../analysis/AnalysisListTable' +import type { Analysis } from './AnalysisListTable' interface LeftPanelProps { selectedAnalysis?: Analysis | null diff --git a/frontend/src/components/analysis/OilSpillTheoryView.tsx b/frontend/src/tabs/prediction/components/OilSpillTheoryView.tsx similarity index 100% rename from frontend/src/components/analysis/OilSpillTheoryView.tsx rename to frontend/src/tabs/prediction/components/OilSpillTheoryView.tsx diff --git a/frontend/src/components/views/OilSpillView.tsx b/frontend/src/tabs/prediction/components/OilSpillView.tsx similarity index 97% rename from frontend/src/components/views/OilSpillView.tsx rename to frontend/src/tabs/prediction/components/OilSpillView.tsx index afb5a8d..b9f74ab 100755 --- a/frontend/src/components/views/OilSpillView.tsx +++ b/frontend/src/tabs/prediction/components/OilSpillView.tsx @@ -1,18 +1,18 @@ import { useState, useEffect } from 'react' -import { LeftPanel } from '../layout/LeftPanel' -import { RightPanel } from '../layout/RightPanel' -import { MapView } from '../map/MapView' -import { AnalysisListTable, type Analysis } from '../analysis/AnalysisListTable' -import { OilSpillTheoryView } from '../analysis/OilSpillTheoryView' -import { BoomDeploymentTheoryView } from '../analysis/BoomDeploymentTheoryView' -import { BacktrackModal } from '../analysis/BacktrackModal' -import { RecalcModal } from '../analysis/RecalcModal' -import { BacktrackReplayBar } from '../map/BacktrackReplayBar' +import { LeftPanel } from './LeftPanel' +import { RightPanel } from './RightPanel' +import { MapView } from '@common/components/map/MapView' +import { AnalysisListTable, type Analysis } from './AnalysisListTable' +import { OilSpillTheoryView } from './OilSpillTheoryView' +import { BoomDeploymentTheoryView } from './BoomDeploymentTheoryView' +import { BacktrackModal } from './BacktrackModal' +import { RecalcModal } from './RecalcModal' +import { BacktrackReplayBar } from '@common/components/map/BacktrackReplayBar' import { useSubMenu, navigateToTab, setReportGenCategory } from '@common/hooks/useSubMenu' import type { BoomLine, AlgorithmSettings, ContainmentResult, BoomLineCoord } from '@common/types/boomLine' import type { BacktrackPhase, BacktrackVessel } from '@common/types/backtrack' import { TOTAL_REPLAY_FRAMES } from '@common/types/backtrack' -import { MOCK_CONDITIONS, MOCK_VESSELS, MOCK_REPLAY_SHIPS, MOCK_COLLISION } from '../../data/backtrackMockData' +import { MOCK_CONDITIONS, MOCK_VESSELS, MOCK_REPLAY_SHIPS, MOCK_COLLISION } from '../../../data/backtrackMockData' export type PredictionModel = 'KOSPS' | 'POSEIDON' | 'OpenDrift' // eslint-disable-next-line react-refresh/only-export-components diff --git a/frontend/src/components/analysis/RecalcModal.tsx b/frontend/src/tabs/prediction/components/RecalcModal.tsx similarity index 99% rename from frontend/src/components/analysis/RecalcModal.tsx rename to frontend/src/tabs/prediction/components/RecalcModal.tsx index 664484e..6e033d4 100755 --- a/frontend/src/components/analysis/RecalcModal.tsx +++ b/frontend/src/tabs/prediction/components/RecalcModal.tsx @@ -1,5 +1,5 @@ import { useState, useRef, useEffect } from 'react' -import type { PredictionModel } from '../views/OilSpillView' +import type { PredictionModel } from './OilSpillView' interface RecalcModalProps { isOpen: boolean diff --git a/frontend/src/components/layout/RightPanel.tsx b/frontend/src/tabs/prediction/components/RightPanel.tsx similarity index 100% rename from frontend/src/components/layout/RightPanel.tsx rename to frontend/src/tabs/prediction/components/RightPanel.tsx diff --git a/frontend/src/tabs/prediction/index.ts b/frontend/src/tabs/prediction/index.ts new file mode 100644 index 0000000..bba2193 --- /dev/null +++ b/frontend/src/tabs/prediction/index.ts @@ -0,0 +1 @@ +export { OilSpillView } from './components/OilSpillView' diff --git a/frontend/src/components/reports/OilSpillReportTemplate.tsx b/frontend/src/tabs/reports/components/OilSpillReportTemplate.tsx similarity index 100% rename from frontend/src/components/reports/OilSpillReportTemplate.tsx rename to frontend/src/tabs/reports/components/OilSpillReportTemplate.tsx diff --git a/frontend/src/components/views/ReportsView.tsx b/frontend/src/tabs/reports/components/ReportsView.tsx similarity index 99% rename from frontend/src/components/views/ReportsView.tsx rename to frontend/src/tabs/reports/components/ReportsView.tsx index c6e6446..3941bdd 100755 --- a/frontend/src/components/views/ReportsView.tsx +++ b/frontend/src/tabs/reports/components/ReportsView.tsx @@ -8,7 +8,7 @@ import { type OilSpillReportData, type ReportType, type Jurisdiction, -} from '../reports/OilSpillReportTemplate' +} from './OilSpillReportTemplate' import { sanitizeHtml } from '@common/utils/sanitize' import { useSubMenu, consumeReportGenCategory } from '@common/hooks/useSubMenu' diff --git a/frontend/src/tabs/reports/index.ts b/frontend/src/tabs/reports/index.ts new file mode 100644 index 0000000..5ba33c4 --- /dev/null +++ b/frontend/src/tabs/reports/index.ts @@ -0,0 +1 @@ +export { ReportsView } from './components/ReportsView' diff --git a/frontend/src/components/analysis/RescueScenarioView.tsx b/frontend/src/tabs/rescue/components/RescueScenarioView.tsx similarity index 100% rename from frontend/src/components/analysis/RescueScenarioView.tsx rename to frontend/src/tabs/rescue/components/RescueScenarioView.tsx diff --git a/frontend/src/components/analysis/RescueTheoryView.tsx b/frontend/src/tabs/rescue/components/RescueTheoryView.tsx similarity index 100% rename from frontend/src/components/analysis/RescueTheoryView.tsx rename to frontend/src/tabs/rescue/components/RescueTheoryView.tsx diff --git a/frontend/src/components/views/RescueView.tsx b/frontend/src/tabs/rescue/components/RescueView.tsx similarity index 99% rename from frontend/src/components/views/RescueView.tsx rename to frontend/src/tabs/rescue/components/RescueView.tsx index 764dfdf..2f890f2 100755 --- a/frontend/src/components/views/RescueView.tsx +++ b/frontend/src/tabs/rescue/components/RescueView.tsx @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react' import { useSubMenu } from '@common/hooks/useSubMenu' -import { RescueTheoryView } from '../analysis/RescueTheoryView' -import { RescueScenarioView } from '../analysis/RescueScenarioView' +import { RescueTheoryView } from './RescueTheoryView' +import { RescueScenarioView } from './RescueScenarioView' /* ─── Types ─── */ type AccidentType = 'collision' | 'grounding' | 'turning' | 'capsizing' | 'sharpTurn' | 'flooding' | 'sinking' diff --git a/frontend/src/tabs/rescue/index.ts b/frontend/src/tabs/rescue/index.ts new file mode 100644 index 0000000..adfd9eb --- /dev/null +++ b/frontend/src/tabs/rescue/index.ts @@ -0,0 +1 @@ +export { RescueView } from './components/RescueView' diff --git a/frontend/src/components/views/PreScatView.tsx b/frontend/src/tabs/scat/components/PreScatView.tsx similarity index 100% rename from frontend/src/components/views/PreScatView.tsx rename to frontend/src/tabs/scat/components/PreScatView.tsx diff --git a/frontend/src/components/weather/OceanCurrentLayer.tsx b/frontend/src/tabs/weather/components/OceanCurrentLayer.tsx similarity index 100% rename from frontend/src/components/weather/OceanCurrentLayer.tsx rename to frontend/src/tabs/weather/components/OceanCurrentLayer.tsx diff --git a/frontend/src/components/weather/OceanForecastOverlay.tsx b/frontend/src/tabs/weather/components/OceanForecastOverlay.tsx similarity index 95% rename from frontend/src/components/weather/OceanForecastOverlay.tsx rename to frontend/src/tabs/weather/components/OceanForecastOverlay.tsx index e34b530..c4a7585 100755 --- a/frontend/src/components/weather/OceanForecastOverlay.tsx +++ b/frontend/src/tabs/weather/components/OceanForecastOverlay.tsx @@ -1,7 +1,7 @@ import { ImageOverlay, useMap } from 'react-leaflet' import { LatLngBounds } from 'leaflet' import { useEffect, useState } from 'react' -import type { OceanForecastData } from '../../services/khoaApi' +import type { OceanForecastData } from '../services/khoaApi' interface OceanForecastOverlayProps { forecast: OceanForecastData | null diff --git a/frontend/src/components/weather/WaterTemperatureLayer.tsx b/frontend/src/tabs/weather/components/WaterTemperatureLayer.tsx similarity index 100% rename from frontend/src/components/weather/WaterTemperatureLayer.tsx rename to frontend/src/tabs/weather/components/WaterTemperatureLayer.tsx diff --git a/frontend/src/components/weather/WeatherMapOverlay.tsx b/frontend/src/tabs/weather/components/WeatherMapOverlay.tsx similarity index 100% rename from frontend/src/components/weather/WeatherMapOverlay.tsx rename to frontend/src/tabs/weather/components/WeatherMapOverlay.tsx diff --git a/frontend/src/components/weather/WeatherRightPanel.tsx b/frontend/src/tabs/weather/components/WeatherRightPanel.tsx similarity index 100% rename from frontend/src/components/weather/WeatherRightPanel.tsx rename to frontend/src/tabs/weather/components/WeatherRightPanel.tsx diff --git a/frontend/src/components/views/WeatherView.tsx b/frontend/src/tabs/weather/components/WeatherView.tsx similarity index 97% rename from frontend/src/components/views/WeatherView.tsx rename to frontend/src/tabs/weather/components/WeatherView.tsx index 811f7b5..c9b8339 100755 --- a/frontend/src/components/views/WeatherView.tsx +++ b/frontend/src/tabs/weather/components/WeatherView.tsx @@ -2,14 +2,14 @@ import { useState, useEffect } from 'react' import { MapContainer, TileLayer, useMapEvents } from 'react-leaflet' import type { LatLngExpression } from 'leaflet' import 'leaflet/dist/leaflet.css' -import { WeatherRightPanel } from '../weather/WeatherRightPanel' -import { WeatherMapOverlay } from '../weather/WeatherMapOverlay' -import { OceanForecastOverlay } from '../weather/OceanForecastOverlay' -import { OceanCurrentLayer } from '../weather/OceanCurrentLayer' -import { WaterTemperatureLayer } from '../weather/WaterTemperatureLayer' -import { WindParticleLayer } from '../weather/WindParticleLayer' -import { useWeatherData } from '../../hooks/useWeatherData' -import { useOceanForecast } from '../../hooks/useOceanForecast' +import { WeatherRightPanel } from './WeatherRightPanel' +import { WeatherMapOverlay } from './WeatherMapOverlay' +import { OceanForecastOverlay } from './OceanForecastOverlay' +import { OceanCurrentLayer } from './OceanCurrentLayer' +import { WaterTemperatureLayer } from './WaterTemperatureLayer' +import { WindParticleLayer } from './WindParticleLayer' +import { useWeatherData } from '../hooks/useWeatherData' +import { useOceanForecast } from '../hooks/useOceanForecast' type TimeOffset = '0' | '3' | '6' | '9' diff --git a/frontend/src/components/weather/WindParticleLayer.tsx b/frontend/src/tabs/weather/components/WindParticleLayer.tsx similarity index 100% rename from frontend/src/components/weather/WindParticleLayer.tsx rename to frontend/src/tabs/weather/components/WindParticleLayer.tsx diff --git a/frontend/src/hooks/useOceanForecast.ts b/frontend/src/tabs/weather/hooks/useOceanForecast.ts similarity index 100% rename from frontend/src/hooks/useOceanForecast.ts rename to frontend/src/tabs/weather/hooks/useOceanForecast.ts diff --git a/frontend/src/hooks/useWeatherData.ts b/frontend/src/tabs/weather/hooks/useWeatherData.ts similarity index 100% rename from frontend/src/hooks/useWeatherData.ts rename to frontend/src/tabs/weather/hooks/useWeatherData.ts diff --git a/frontend/src/tabs/weather/index.ts b/frontend/src/tabs/weather/index.ts new file mode 100644 index 0000000..e4dd76d --- /dev/null +++ b/frontend/src/tabs/weather/index.ts @@ -0,0 +1 @@ +export { WeatherView } from './components/WeatherView' diff --git a/frontend/src/services/khoaApi.ts b/frontend/src/tabs/weather/services/khoaApi.ts similarity index 100% rename from frontend/src/services/khoaApi.ts rename to frontend/src/tabs/weather/services/khoaApi.ts diff --git a/frontend/src/services/weatherApi.ts b/frontend/src/tabs/weather/services/weatherApi.ts similarity index 100% rename from frontend/src/services/weatherApi.ts rename to frontend/src/tabs/weather/services/weatherApi.ts diff --git a/frontend/src/services/weatherService.ts b/frontend/src/tabs/weather/services/weatherService.ts similarity index 100% rename from frontend/src/services/weatherService.ts rename to frontend/src/tabs/weather/services/weatherService.ts