Spaces:
Running
Running
feat(ui): revolucao visual estilo google com layout limpo, caixas flutuantes colapsaveis e editor maximizado
74435d2 Download src/components/ControlSidebar.jsx from FuturoEPT/simuladorcnc: direct link, hf CLI and curl.
- Browser
- Download file 2.66 kB
-
https://huggingface.co/spaces/FuturoEPT/simuladorcnc/resolve/main/src/components/ControlSidebar.jsx
- Command line
-
hf download hf://spaces/FuturoEPT/simuladorcnc/src/components/ControlSidebar.jsx
-
curl -L -o ControlSidebar.jsx https://huggingface.co/spaces/FuturoEPT/simuladorcnc/resolve/main/src/components/ControlSidebar.jsx
2.66 kB
| import React, { useState } from 'react'; | |
| import EditorTab from './EditorTab.jsx'; | |
| import MagazineTab from './MagazineTab.jsx'; | |
| import JogTab from './JogTab.jsx'; | |
| import { FileCode, Wrench, Compass } from 'lucide-react'; | |
| export default function ControlSidebar(props) { | |
| const [activeTab, setActiveTab] = useState('editor'); // 'editor' | 'tools' | 'jog' | |
| return ( | |
| <aside className="w-full lg:w-[520px] xl:w-[580px] bg-slate-900 border-l border-slate-800 flex flex-col h-[560px] lg:h-full z-20 shrink-0 shadow-2xl"> | |
| {/* TABS HEADER */} | |
| <div className="flex border-b border-slate-800 bg-slate-950/80 p-1.5 gap-1 shrink-0"> | |
| <button | |
| type="button" | |
| onClick={() => setActiveTab('editor')} | |
| className={`flex-1 py-1.5 px-2 text-xs font-semibold rounded-lg transition-all flex items-center justify-center gap-1.5 ${ | |
| activeTab === 'editor' | |
| ? 'bg-blue-600 text-white shadow-sm font-bold' | |
| : 'text-slate-400 hover:text-slate-200 hover:bg-slate-850' | |
| }`} | |
| > | |
| <FileCode size={14} /> | |
| <span>Editor & Projetos</span> | |
| </button> | |
| <button | |
| type="button" | |
| onClick={() => setActiveTab('tools')} | |
| className={`flex-1 py-1.5 px-2 text-xs font-semibold rounded-lg transition-all flex items-center justify-center gap-1.5 ${ | |
| activeTab === 'tools' | |
| ? 'bg-blue-600 text-white shadow-sm font-bold' | |
| : 'text-slate-400 hover:text-slate-200 hover:bg-slate-850' | |
| }`} | |
| > | |
| <Wrench size={14} /> | |
| <span>Magazine (M06)</span> | |
| </button> | |
| <button | |
| type="button" | |
| onClick={() => setActiveTab('jog')} | |
| className={`flex-1 py-1.5 px-2 text-xs font-semibold rounded-lg transition-all flex items-center justify-center gap-1.5 ${ | |
| activeTab === 'jog' | |
| ? 'bg-blue-600 text-white shadow-sm font-bold' | |
| : 'text-slate-400 hover:text-slate-200 hover:bg-slate-850' | |
| }`} | |
| > | |
| <Compass size={14} /> | |
| <span>JOG Manual</span> | |
| </button> | |
| </div> | |
| {/* ACTIVE TAB CONTENT */} | |
| {activeTab === 'editor' && <EditorTab {...props} />} | |
| {activeTab === 'tools' && ( | |
| <MagazineTab | |
| activeToolNumber={props.toolNumber} | |
| onSelectTool={props.onSelectTool} | |
| /> | |
| )} | |
| {activeTab === 'jog' && ( | |
| <JogTab | |
| onJog={props.onJog} | |
| onJogHome={props.onJogHome} | |
| spindleState={props.spindleState} | |
| onToggleSpindle={props.onToggleSpindle} | |
| /> | |
| )} | |
| </aside> | |
| ); | |
| } | |