drafting tools

This commit is contained in:
wass08
2026-01-17 08:58:17 +09:00
parent 536c2e94cc
commit 59be752eb4
35 changed files with 166 additions and 12 deletions
@@ -0,0 +1,25 @@
import useEditor, { Phase, Tool } from "@/store/use-editor";
import { WallTool } from "./wall/wall-tool";
const tools: Record<Phase, Partial<Record<Tool, React.FC>>> = {
site: {
},
structure: {
wall: WallTool,
},
furnish: {
},
};
export const ToolManager: React.FC = () => {
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;
const Component = tools[phase]?.[tool];
return Component ? <Component /> : null;
};