Spaces:
Running
Running
File size: 473 Bytes
fc288c8 be9292f d905dfb 8457270 be9292f d905dfb be9292f fc288c8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | 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; |