wing-ops/frontend/src/tabs/admin/components/AdminView.tsx
Nan Kyung Lee 387e2a2e40 feat(rescue): 긴급구난/예측도 OSM 지도 적용 및 관리자 패널 추가
- RescueView: CenterMap을 MapView(useBaseMapStyle) 기반 OSM 지도로 교체
- RescueScenarioView: BASE_STYLE → useBaseMapStyle로 전환하여 OSM 통일
- 긴급구난 시나리오 시드 데이터 10건으로 확장 (모델 이론 기반)
- 관리자 비식별화조치 R&D 패널 5종 추가 (HNS대기, KOSPS, POSEIDON, Rescue, 시스템아키텍처)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 19:46:12 +09:00

76 lines
3.2 KiB
TypeScript
Executable File

import React, { useState } from 'react';
import AdminSidebar from './AdminSidebar';
import AdminPlaceholder from './AdminPlaceholder';
import { findMenuLabel } from './adminMenuConfig';
import UsersPanel from './UsersPanel';
import PermissionsPanel from './PermissionsPanel';
import MenusPanel from './MenusPanel';
import SettingsPanel from './SettingsPanel';
import BoardMgmtPanel from './BoardMgmtPanel';
import VesselSignalPanel from './VesselSignalPanel';
import CleanupEquipPanel from './CleanupEquipPanel';
import AssetUploadPanel from './AssetUploadPanel';
import MapBasePanel from './MapBasePanel';
import LayerPanel from './LayerPanel';
import SensitiveLayerPanel from './SensitiveLayerPanel';
import DispersingZonePanel from './DispersingZonePanel';
import MonitorRealtimePanel from './MonitorRealtimePanel';
import MonitorVesselPanel from './MonitorVesselPanel';
import CollectHrPanel from './CollectHrPanel';
import MonitorForecastPanel from './MonitorForecastPanel';
import VesselMaterialsPanel from './VesselMaterialsPanel';
import DeidentifyPanel from './DeidentifyPanel';
import RndPoseidonPanel from './RndPoseidonPanel';
import RndKospsPanel from './RndKospsPanel';
import RndHnsAtmosPanel from './RndHnsAtmosPanel';
import RndRescuePanel from './RndRescuePanel';
import SystemArchPanel from './SystemArchPanel';
/** 기존 패널이 있는 메뉴 ID 매핑 */
const PANEL_MAP: Record<string, () => React.JSX.Element> = {
users: () => <UsersPanel />,
permissions: () => <PermissionsPanel />,
menus: () => <MenusPanel />,
settings: () => <SettingsPanel />,
notice: () => <BoardMgmtPanel initialCategory="NOTICE" />,
board: () => <BoardMgmtPanel initialCategory="DATA" />,
qna: () => <BoardMgmtPanel initialCategory="QNA" />,
'collect-vessel-signal': () => <VesselSignalPanel />,
'cleanup-equip': () => <CleanupEquipPanel />,
'asset-upload': () => <AssetUploadPanel />,
'map-base': () => <MapBasePanel />,
'map-layer': () => <LayerPanel />,
'env-ecology': () => <SensitiveLayerPanel categoryCode="LYR001002001" title="환경/생태" />,
'social-economy': () => <SensitiveLayerPanel categoryCode="LYR001002002" title="사회/경제" />,
'dispersant-zone': () => <DispersingZonePanel />,
'vessel-materials': () => <VesselMaterialsPanel />,
'monitor-realtime': () => <MonitorRealtimePanel />,
'monitor-vessel': () => <MonitorVesselPanel />,
'collect-hr': () => <CollectHrPanel />,
'monitor-forecast': () => <MonitorForecastPanel />,
deidentify: () => <DeidentifyPanel />,
'rnd-poseidon': () => <RndPoseidonPanel />,
'rnd-kosps': () => <RndKospsPanel />,
'rnd-hns-atmos': () => <RndHnsAtmosPanel />,
'rnd-rescue': () => <RndRescuePanel />,
'system-arch': () => <SystemArchPanel />,
};
export function AdminView() {
const [activeMenu, setActiveMenu] = useState('users');
const renderContent = () => {
const factory = PANEL_MAP[activeMenu];
if (factory) return factory();
const label = findMenuLabel(activeMenu) ?? activeMenu;
return <AdminPlaceholder label={label} />;
};
return (
<div className="flex flex-1 overflow-hidden bg-bg-base">
<AdminSidebar activeMenu={activeMenu} onSelect={setActiveMenu} />
<div className="flex-1 flex flex-col overflow-hidden">{renderContent()}</div>
</div>
);
}