diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-01-30 11:31:24 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-01-30 13:05:48 +0100 |
| commit | 0d4b61993cba37c180ac91e40a0fb362711de8de (patch) | |
| tree | f41dd68420b51766c1ca6fc1ee2c20dc5df830d1 /src/components/Sidebar.tsx | |
Initial implementation
Diffstat (limited to 'src/components/Sidebar.tsx')
| -rw-r--r-- | src/components/Sidebar.tsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx new file mode 100644 index 0000000..97d923b --- /dev/null +++ b/src/components/Sidebar.tsx @@ -0,0 +1,30 @@ +import React from "react"; +import { useStore } from "../store/store.ts"; + +export const Sidebar: React.FC = () => { + const availableModels = useStore((state) => state.availableModels); + const addModel = useStore((state) => state.addModel); + + const handleAdd = (modelId: string) => { + addModel(modelId, { x: 0, y: 0, z: 0 }); + }; + + return ( + <section className="sidebar"> + <h2 className="sidebar-title">Models</h2> + <nav className="model-list"> + {availableModels.map((model) => ( + <article key={model.id} className="model-item"> + <span className="model-name">{model.name}</span> + <button + className="add-model-btn" + onClick={() => handleAdd(model.id)} + > + Add + </button> + </article> + ))} + </nav> + </section> + ); +}; |