정보검색 팝업 조회조건 공통코드 초기화

This commit is contained in:
kiminchan
2026-06-25 10:22:40 +09:00
parent 2767260505
commit be67395f13
@@ -1,5 +1,48 @@
"use client";
import SearchModal from "@/app/(map-layout)/map/searchModal/searchModal";
import useStore from "@/store/useStore";
import { useEffect } from "react";
export default function SearchModalPopupContent() {
const {
ctpv,
sgg,
BIZ_SE_CD,
BIZ_TY_CD,
fetchCtpv,
fetchSgg,
fetchBIZ_SE_CD,
fetchBIZ_TY_CD,
} = useStore();
useEffect(() => {
// Popup windows do not run map-layout initialization, so load search codes here.
if (ctpv.length === 0) {
void fetchCtpv();
}
if (sgg.length === 0) {
void fetchSgg();
}
if (BIZ_SE_CD.length === 0) {
void fetchBIZ_SE_CD();
}
if (BIZ_TY_CD.length === 0) {
void fetchBIZ_TY_CD();
}
}, [
BIZ_SE_CD.length,
BIZ_TY_CD.length,
ctpv.length,
fetchBIZ_SE_CD,
fetchBIZ_TY_CD,
fetchCtpv,
fetchSgg,
sgg.length,
]);
return <SearchModal renderMode="popup" />;
}