Spaces:
Running
Running
Download src/components/ModuleSelector.jsx from tung14/deepsite-project: direct link, hf CLI and curl.
- Browser
- Download file 980 Bytes
-
https://huggingface.co/spaces/tung14/deepsite-project/resolve/main/src/components/ModuleSelector.jsx
- Command line
-
hf download hf://spaces/tung14/deepsite-project/src/components/ModuleSelector.jsx
-
curl -L -o ModuleSelector.jsx https://huggingface.co/spaces/tung14/deepsite-project/resolve/main/src/components/ModuleSelector.jsx
980 Bytes
| ```javascript | |
| export default function ModuleSelector({ activeModule, setActiveModule }) { | |
| const modules = [ | |
| { id: 'chat', name: 'Chat', icon: 'message-square' }, | |
| { id: 'math', name: 'Math', icon: 'divide-square' }, | |
| { id: 'chinese', name: 'Chinese', icon: 'file-text' }, | |
| { id: 'proxy', name: 'Proxy Apps', icon: 'command' } | |
| ] | |
| return ( | |
| <div className="p-4"> | |
| <h2 className="text-lg font-bold mb-4">Modules</h2> | |
| <ul> | |
| {modules.map((module) => ( | |
| <li key={module.id} className="mb-2"> | |
| <button | |
| onClick={() => setActiveModule(module.id)} | |
| className={`w-full text-left p-2 rounded-lg flex items-center ${activeModule === module.id | |
| ? 'bg-blue-500 text-white' | |
| : 'hover:bg-gray-100'}`}> | |
| <i data-feather={module.icon} className="mr-2"></i> | |
| {module.name} | |
| </button> | |
| </li> | |
| ))} | |
| </ul> | |
| </div> | |
| ) | |
| } | |
| ``` |