18 lines
592 B
TypeScript
18 lines
592 B
TypeScript
import SwtrmtFclt from "./SwtrmtFclt";
|
|
|
|
// 레이어 이름과 컴포넌트를 매핑
|
|
const layerContentMap: { [key: string]: { component: React.FC<any>; props?: any; } } = {
|
|
"하수처리시설": {
|
|
component: SwtrmtFclt,
|
|
},
|
|
"하수처리구역": {component : SwtrmtFclt,}
|
|
};
|
|
|
|
// 동적 컴포넌트 반환 함수
|
|
export const getLayerContentComponent = (layerNm: string): React.FC => {
|
|
const component = layerContentMap[layerNm];
|
|
if (!component) {
|
|
throw new Error(`Component not found for layer name: ${layerNm}`);
|
|
}
|
|
return component.component;
|
|
}; |