|
|
@@ -1,19 +1,28 @@
|
|
|
import React from 'react';
|
|
|
-import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
|
|
|
-import Home from './pages/Home';
|
|
|
-import Invoices from './pages/Invoices';
|
|
|
-import Clients from './pages/Clients';
|
|
|
+import { BrowserRouter as Router, Route, Routes, Link } from 'react-router-dom';
|
|
|
+import InvoiceList from './components/InvoiceList';
|
|
|
+import ClientList from './components/ClientList';
|
|
|
+import Home from './components/Home';
|
|
|
|
|
|
function App() {
|
|
|
return (
|
|
|
<Router>
|
|
|
- <div>
|
|
|
+ <div style={{ padding: '20px' }}>
|
|
|
<h1>Invoice Notification App</h1>
|
|
|
- <Switch>
|
|
|
- <Route path="/" exact component={Home} />
|
|
|
- <Route path="/invoices" component={Invoices} />
|
|
|
- <Route path="/clients" component={Clients} />
|
|
|
- </Switch>
|
|
|
+
|
|
|
+ {/* Navigation Bar */}
|
|
|
+ <nav style={{ marginBottom: '20px' }}>
|
|
|
+ <Link to="/" style={{ marginRight: '15px' }}>Home</Link>
|
|
|
+ <Link to="/invoices" style={{ marginRight: '15px' }}>Invoices</Link>
|
|
|
+ <Link to="/clients">Clients</Link>
|
|
|
+ </nav>
|
|
|
+
|
|
|
+ {/* Routes */}
|
|
|
+ <Routes>
|
|
|
+ <Route path="/" element={<Home />} />
|
|
|
+ <Route path="/invoices" element={<InvoiceList />} />
|
|
|
+ <Route path="/clients" element={<ClientList />} />
|
|
|
+ </Routes>
|
|
|
</div>
|
|
|
</Router>
|
|
|
);
|