-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
67 lines (62 loc) · 2.36 KB
/
Copy pathApp.tsx
File metadata and controls
67 lines (62 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import React from 'react';
import { HashRouter as Router, Routes, Route, useLocation } from 'react-router-dom';
import { Layout } from './components/Layout';
import { Dashboard } from './pages/Dashboard';
import { Reports } from './pages/Reports';
import { Books } from './pages/Books';
import { AddBook } from './pages/AddBook';
import { Authors } from './pages/Authors';
import { AddAuthor } from './pages/AddAuthor';
import { Members } from './pages/Members';
import { AddMember } from './pages/AddMember';
import { MemberProfile } from './pages/MemberProfile';
import { Circulation } from './pages/Circulation';
import { BookReturn } from './pages/BookReturn';
import { RenewBook } from './pages/RenewBook';
import { BorrowingManagement } from './pages/BorrowingManagement';
import { Events } from './pages/Events';
import { Branches } from './pages/Branches';
import { Settings } from './pages/Settings';
import { Catalog } from './pages/Catalog';
import { Login } from './pages/Login';
const AppContent = () => {
const location = useLocation();
const isLoginPage = location.pathname === '/login';
if (isLoginPage) {
return (
<Routes>
<Route path="/login" element={<Login />} />
</Routes>
);
}
return (
<Layout>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/reports" element={<Reports />} />
<Route path="/books" element={<Books />} />
<Route path="/add-book" element={<AddBook />} />
<Route path="/authors" element={<Authors />} />
<Route path="/add-author" element={<AddAuthor />} />
<Route path="/members" element={<Members />} />
<Route path="/add-member" element={<AddMember />} />
<Route path="/member/:id" element={<MemberProfile />} />
<Route path="/circulation" element={<Circulation />} />
<Route path="/return" element={<BookReturn />} />
<Route path="/renew" element={<RenewBook />} />
<Route path="/borrowing-management" element={<BorrowingManagement />} />
<Route path="/events" element={<Events />} />
<Route path="/branches" element={<Branches />} />
<Route path="/settings" element={<Settings />} />
<Route path="/catalog" element={<Catalog />} />
</Routes>
</Layout>
);
};
export default function App() {
return (
<Router>
<AppContent />
</Router>
);
}