85 lines
2.6 KiB
TypeScript
85 lines
2.6 KiB
TypeScript
"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 "하수재이용시설":
|
|
return (
|
|
<RuseFacility
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
case "하수처리시설":
|
|
return (
|
|
<HasuFacility
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
case "빗물이용시설":
|
|
return (
|
|
<RainFacility
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
case "중수도시설":
|
|
return (
|
|
<RswtFacility
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
case "온배수시설":
|
|
return (
|
|
<HtdflFacility
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
case "수요처":
|
|
return (
|
|
<CoSttnMap
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
case "잠재수요처":
|
|
return (
|
|
<LdrmntCoMap
|
|
rtnFeature={(feature) => {
|
|
bc.postMessage({ type: "SELECT_FEATURE", feature });
|
|
}}
|
|
/>
|
|
);
|
|
default:
|
|
return null; // 안전하게 아무 것도 렌더링하지 않음
|
|
}
|
|
};
|
|
return (
|
|
<>
|
|
<div>{renderConditionalContent()}</div>
|
|
</>
|
|
);
|
|
}
|