t2-mapper/src/components/renderObject.tsx

22 lines
589 B
TypeScript
Raw Normal View History

import { ConsoleObject } from "../mission";
2025-11-14 06:55:58 +00:00
import { TerrainBlock } from "./TerrainBlock";
import { WaterBlock } from "./WaterBlock";
import { SimGroup } from "./SimGroup";
import { InteriorInstance } from "./InteriorInstance";
import { Sky } from "./Sky";
import { Sun } from "./Sun";
2025-11-14 06:55:58 +00:00
const componentMap = {
SimGroup,
TerrainBlock,
WaterBlock,
InteriorInstance,
Sky,
Sun,
2025-11-14 06:55:58 +00:00
};
export function renderObject(object: ConsoleObject, key: string | number) {
const Component = componentMap[object.className];
return Component ? <Component key={key} object={object} /> : null;
}