2026-07-20 12:31:18 +08:00
|
|
|
import { useEffect } from "react";
|
|
|
|
|
import { FloorPlan } from "./components/FloorPlan";
|
|
|
|
|
import { HeaderBar } from "./components/HeaderBar";
|
|
|
|
|
import { SidePanel } from "./components/SidePanel";
|
|
|
|
|
import { startRuntime } from "./sim/runtime";
|
|
|
|
|
import { useOfficeStore } from "./store/office-store";
|
|
|
|
|
|
|
|
|
|
export default function App() {
|
|
|
|
|
const theme = useOfficeStore((s) => s.theme);
|
2026-07-20 13:40:38 +08:00
|
|
|
const panelOpen = useOfficeStore((s) => s.panelOpen);
|
2026-07-20 12:31:18 +08:00
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
startRuntime();
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={`app ${theme}`}>
|
|
|
|
|
<HeaderBar />
|
2026-07-20 13:40:38 +08:00
|
|
|
<div className={`main-row ${panelOpen ? "" : "panel-closed"}`}>
|
2026-07-20 12:31:18 +08:00
|
|
|
<FloorPlan />
|
2026-07-20 13:40:38 +08:00
|
|
|
{panelOpen && <SidePanel />}
|
2026-07-20 12:31:18 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|