zone creation editor

This commit is contained in:
wass08
2026-01-22 10:11:15 +09:00
parent 3ab5077ea0
commit 68e573f494
5 changed files with 550 additions and 14 deletions
+13 -11
View File
@@ -1,26 +1,28 @@
import useEditor, { type Phase, type Tool } from '@/store/use-editor'
import { ItemTool } from './item/item-tool'
import { WallTool } from './wall/wall-tool'
import useEditor, { type Phase, type Tool } from "@/store/use-editor";
import { ItemTool } from "./item/item-tool";
import { WallTool } from "./wall/wall-tool";
import { ZoneTool } from "./zone/zone-tool";
const tools: Record<Phase, Partial<Record<Tool, React.FC>>> = {
site: {},
structure: {
wall: WallTool,
item: ItemTool,
zone: ZoneTool,
},
furnish: {
item: ItemTool,
},
}
};
export const ToolManager: React.FC = () => {
const phase = useEditor((state) => state.phase)
const mode = useEditor((state) => state.mode)
const tool = useEditor((state) => state.tool)
const phase = useEditor((state) => state.phase);
const mode = useEditor((state) => state.mode);
const tool = useEditor((state) => state.tool);
if (mode !== 'build' || tool === null) return null
if (mode !== "build" || tool === null) return null;
const Component = tools[phase]?.[tool]
const Component = tools[phase]?.[tool];
return Component ? <Component /> : null
}
return Component ? <Component /> : null;
};