bringing back ui components

This commit is contained in:
wass08
2026-01-16 10:49:22 +09:00
parent 60cb60fdaa
commit d657f4125f
28 changed files with 2487 additions and 192 deletions
+55
View File
@@ -0,0 +1,55 @@
"use client";
import { create } from "zustand";
export type Phase = "site" | "structure" | "furnish";
export type Mode = "select" | "edit" | "delete" | "build";
// Structure mode tools (building elements)
export type StructureTool =
| "wall"
| "room"
| "custom-room"
| "slab"
| "ceiling"
| "roof"
| "column"
| "stair"
| "door"
| "window"
| "zone";
// Furnish mode tools (items and decoration)
export type FurnishTool =
| "furniture"
| "appliance"
| "kitchen"
| "bathroom"
| "outdoor"
| "painting";
// Site mode tools
export type SiteTool = "property-line";
// Combined tool type
export type Tool = SiteTool | StructureTool | FurnishTool;
type EditorState = {
phase: Phase;
setPhase: (phase: Phase) => void;
mode: Mode;
setMode: (mode: Mode) => void;
tool: Tool | null;
setTool: (tool: Tool | null) => void;
};
const useEditor = create<EditorState>()((set, get) => ({
phase: "site",
setPhase: (phase) => set({ phase }),
mode: "select",
setMode: (mode) => set({ mode }),
tool: null,
setTool: (tool) => set({ tool }),
}));
export default useEditor;