Spaces:
Running
Running
Download src/components/ModuleLauncher.jsx from tung14/deepsite-project: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/tung14/deepsite-project/resolve/main/src/components/ModuleLauncher.jsx
- Command line
-
hf download hf://spaces/tung14/deepsite-project/src/components/ModuleLauncher.jsx
-
curl -L -o ModuleLauncher.jsx https://huggingface.co/spaces/tung14/deepsite-project/resolve/main/src/components/ModuleLauncher.jsx
1.21 kB
| ```javascript | |
| export function ModuleLauncher({ activeModule, setActiveModule, availableModules }) { | |
| const modules = [ | |
| { id: 'math', name: 'Math Reference', icon: 'fa-calculator' }, | |
| { id: 'chinese', name: 'Chinese Vocab', icon: 'fa-language' }, | |
| { id: 'troubleshooting', name: 'System Help', icon: 'fa-tools' } | |
| ]; | |
| return ( | |
| <div className="mb-8 p-6 rounded-lg shadow-md bg-gradient-to-br from-blue-500 to-blue-600 text-white"> | |
| <h3 className="text-xl font-semibold mb-4">Launch Modules</h3> | |
| <div className="space-y-3"> | |
| {modules.filter(m => availableModules.includes(m.id)).map((module) => ( | |
| <button | |
| key={module.id} | |
| onClick={() => setActiveModule(activeModule === module.id ? null : module.id)} | |
| className={`w-full flex items-center p-3 rounded-lg transition-all ${ | |
| activeModule === module.id | |
| ? 'bg-white text-blue-600 shadow-lg' | |
| : 'bg-blue-400 hover:bg-blue-300 hover:text-blue-800' | |
| }`} | |
| > | |
| <i className={`fas ${module.icon} mr-3`}></i> | |
| <span>{module.name}</span> | |
| </button> | |
| ))} | |
| </div> | |
| </div> | |
| ); | |
| } | |
| ``` |