Spaces:
Running
Running
| import React from "react"; | |
| import Home from "./pages/Home"; | |
| import VisitLog from "./pages/VisitLog"; | |
| function App() { | |
| // Read the 'page' query parameter from the URL | |
| const urlParams = new URLSearchParams(window.location.search); | |
| const page = urlParams.get("page"); | |
| // Conditionally render the component based on the query parameter | |
| if (page === "visit-log") { | |
| return <VisitLog />; | |
| } | |
| // Default to the Home page | |
| return <Home />; | |
| } | |
| export default App; |