import { Switch, Route } from "wouter"; import { queryClient } from "./lib/queryClient"; import { QueryClientProvider } from "@tanstack/react-query"; import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; import { ThemeProvider } from "@/components/theme-provider"; import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; import { AppSidebar } from "@/components/app-sidebar"; import { useAuth } from "@/hooks/useAuth"; import NotFound from "@/pages/not-found"; import Landing from "@/pages/landing"; import Login from "@/pages/login"; import Dashboard from "@/pages/dashboard"; import Guards from "@/pages/guards"; import Sites from "@/pages/sites"; import Shifts from "@/pages/shifts"; import Reports from "@/pages/reports"; import Notifications from "@/pages/notifications"; import Users from "@/pages/users"; import AdvancedPlanning from "@/pages/advanced-planning"; import Vehicles from "@/pages/vehicles"; import Parameters from "@/pages/parameters"; import Services from "@/pages/services"; import Planning from "@/pages/planning"; import OperationalPlanning from "@/pages/operational-planning"; import GeneralPlanning from "@/pages/general-planning"; import ServicePlanning from "@/pages/service-planning"; import Customers from "@/pages/customers"; import PlanningMobile from "@/pages/planning-mobile"; import MyShiftsFixed from "@/pages/my-shifts-fixed"; import MyShiftsMobile from "@/pages/my-shifts-mobile"; import SitePlanningView from "@/pages/site-planning-view"; function Router() { const { isAuthenticated, isLoading } = useAuth(); return ( {isLoading || !isAuthenticated ? ( ) : ( <> )} ); } function AppContent() { const { isAuthenticated, isLoading } = useAuth(); // Sidebar style configuration for operational dashboard const sidebarStyle = { "--sidebar-width": "16rem", "--sidebar-width-icon": "3rem", } as React.CSSProperties; return ( {!isLoading && isAuthenticated ? (
) : ( )}
); } function App() { return ( ); } export default App;