"use client"; import { CoSttnMap } from "@/components/ui/map/LayerPopUp/CoSttnMap/CoSttnMap"; import { HasuFacility } from "@/components/ui/map/LayerPopUp/HasuFacilty/HasuFacility"; import { HtdflFacility } from "@/components/ui/map/LayerPopUp/HedfFacilty/HtdfFacilty"; import { LdrmntCoMap } from "@/components/ui/map/LayerPopUp/LdrmntCoMap/LdrmntCoMap"; import { RainFacility } from "@/components/ui/map/LayerPopUp/RainFacility/RainFacility"; import { RswtFacility } from "@/components/ui/map/LayerPopUp/RswtFacilty/RswtFacilty"; import { RuseFacility } from "@/components/ui/map/LayerPopUp/RuseFacilty/RuseFacility"; import { useSearchParams } from "next/navigation"; export default function MapDetailPopUp() { const searchParams = useSearchParams(); const bc = new BroadcastChannel("mapDetailPopUp"); const renderConditionalContent = () => { const layerId = searchParams.get("layerNm"); switch (layerId) { case "tb_wr_bdst_ruse_fclt": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); case "tb_il_swage_prcs_fclt": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); case "tb_wr_rnwtr_utztn_fclt": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); case "tb_wr_rswtr_fclt": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); case "tb_wr_htdfl_fclt": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); case "tb_wr_ruse_fclt_dmd_co": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); case "tb_wr_tmpr_dmd_co": return ( { bc.postMessage({ type: "SELECT_FEATURE", feature }); }} /> ); default: return null; // 안전하게 아무 것도 렌더링하지 않음 } }; return ( <>
{renderConditionalContent()}
); }