Spaces:
Sleeping
Sleeping
Download frontend/src/App.js from notha99y/timetablev2: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/notha99y/timetablev2/resolve/main/frontend/src/App.js
- Command line
-
hf download hf://spaces/notha99y/timetablev2/frontend/src/App.js
-
curl -L -o App.js https://huggingface.co/spaces/notha99y/timetablev2/resolve/main/frontend/src/App.js
1.41 kB
| import React, { useState } from 'react'; | |
| import { Toaster } from 'react-hot-toast'; | |
| import { ThemeProvider } from './contexts/ThemeContext'; | |
| import ModuleInput from './components/ModuleInput'; | |
| import SearchResults from './components/SearchResults'; | |
| import Header from './components/Header'; | |
| function App() { | |
| const [searchResults, setSearchResults] = useState(null); | |
| const [isLoading, setIsLoading] = useState(false); | |
| const clearResults = () => { | |
| setSearchResults(null); | |
| setIsLoading(false); | |
| }; | |
| return ( | |
| <ThemeProvider> | |
| <div className="min-h-screen bg-gray-50 dark:bg-gray-900 transition-colors duration-200"> | |
| <Toaster | |
| position="top-right" | |
| toastOptions={{ | |
| className: 'dark:bg-gray-800 dark:text-white', | |
| }} | |
| /> | |
| <Header /> | |
| <main className="container mx-auto px-4 py-8"> | |
| <div className="max-w-6xl mx-auto"> | |
| <ModuleInput | |
| onResults={setSearchResults} | |
| isLoading={isLoading} | |
| setIsLoading={setIsLoading} | |
| /> | |
| {searchResults && ( | |
| <SearchResults | |
| results={searchResults} | |
| isLoading={isLoading} | |
| onClearResults={clearResults} | |
| /> | |
| )} | |
| </div> | |
| </main> | |
| </div> | |
| </ThemeProvider> | |
| ); | |
| } | |
| export default App; |