Enhance scheduling features in management dashboard

- Added new scheduling functionality with a dedicated Scheduling component to manage availability and experiment scheduling.
- Integrated react-big-calendar for visual calendar representation of availability slots.
- Updated Dashboard and DashboardLayout components to handle current route and pass it to child components.
- Implemented route handling for scheduling sub-routes to improve user navigation.
- Added new dependencies: moment and react-big-calendar for date handling and calendar UI.
- Improved user experience with dynamic URL updates based on selected scheduling views.
This commit is contained in:
salirezav
2025-09-19 12:33:25 -04:00
parent d1fe478478
commit ed6c242faa
8 changed files with 1656 additions and 574 deletions

View File

@@ -99,6 +99,20 @@ function App() {
return match ? `camera${match[1]}` : null
}
// Check if current route is a scheduling sub-route
const isSchedulingRoute = (route: string) => {
return route.startsWith('/scheduling')
}
// Extract scheduling sub-route
const getSchedulingSubRoute = (route: string) => {
if (route === '/scheduling') {
return 'main'
}
const match = route.match(/^\/scheduling\/(.+)$/)
return match ? match[1] : 'main'
}
if (loading) {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-50">
@@ -133,7 +147,7 @@ function App() {
return (
<>
{isAuthenticated ? (
<Dashboard onLogout={handleLogout} />
<Dashboard onLogout={handleLogout} currentRoute={currentRoute} />
) : (
<Login onLoginSuccess={handleLoginSuccess} />
)}