()
| 11 | import Header from "./components/Header"; |
| 12 | |
| 13 | function App() { |
| 14 | // Dark Mode (ContextAPI can also be used) |
| 15 | const [theme, setTheme] = useState("dark"); |
| 16 | const toggleTheme = () => { |
| 17 | setTheme((curr) => (curr === "light" ? "dark" : "light")); |
| 18 | }; |
| 19 | |
| 20 | return ( |
| 21 | <div className={`App_${theme}`}> |
| 22 | <Header toggleTheme={toggleTheme} theme={theme} /> |
| 23 | <Routes> |
| 24 | <Route path="/" element={<Home theme={theme} />} /> |
| 25 | <Route path="/Books" element={<AllBooks theme={theme} />} /> |
| 26 | <Route path="/Authors" element={<AllAuthors theme={theme} />} /> |
| 27 | <Route path="/Book/:id" element={<Book theme={theme} />} /> |
| 28 | <Route path="/Author/:id" element={<Author />} /> |
| 29 | </Routes> |
| 30 | </div> |
| 31 | ); |
| 32 | } |
| 33 | |
| 34 | export default App; |
nothing calls this directly
no outgoing calls
no test coverage detected