"use client"; import { useState } from "react"; import { ChartColumnBig, ChevronLeft, ChevronRight, History, PanelsTopLeft, PencilRuler, Search, Settings2, TriangleAlert, Waves, } from "lucide-react"; import type { WindowPopupKey } from "@/features/windowPopup/model/popupDefinitions"; type Props = { onOpenPopup: (popupKey: WindowPopupKey) => void; onOpenInfoSearch: () => void; }; const ANALYSIS_POPUP_ITEMS: Array<{ key: WindowPopupKey | "infoSearch"; label: string; icon: typeof ChartColumnBig; }> = [ { key: "infoSearch", label: "정보검색", icon: Search }, { key: "pipeAnalysisPopup", label: "관로분석", icon: ChartColumnBig }, { key: "floodPredictionMapPopup", label: "침수예측지도", icon: Waves }, { key: "floodHistoryPopup", label: "침수발생이력", icon: History }, { key: "gisEditPopup", label: "GIS 편집", icon: PencilRuler }, { key: "gisManagementPopup", label: "GIS 관리", icon: Settings2 }, { key: "flowRiskPopup", label: "통수 위험", icon: TriangleAlert }, ]; export default function AnalysisPopupMenu({ onOpenPopup, onOpenInfoSearch }: Props) { const [isOpen, setIsOpen] = useState(true); const [activeKey, setActiveKey] = useState(null); return (
{isOpen ? (
분석도구
{ANALYSIS_POPUP_ITEMS.map((item) => { const Icon = item.icon; const isActive = activeKey === item.key; return ( ); })}
) : null}
); }