import { Suspense, lazy } from "react"; import { Navigate, Route, Routes } from "react-router-dom"; import AppLayout from "@/layouts/AppLayout"; import { useAuth } from "@/hooks/useAuth"; import { menuRoutes,extraRoutes } from "./routes"; const Login = lazy(() => import("@/pages/auth/login")); const ResetPassword = lazy(() => import("@/pages/auth/reset-password")); const MeetingPreview = lazy(() => import("@/pages/business/MeetingPreview")); function RouteFallback() { return
Loading...
; } function RequireAuth({ children }: { children: JSX.Element }) { const { isAuthed, profile } = useAuth(); if (!isAuthed) { return ; } if (profile?.pwdResetRequired === 1) { return ; } return children; } export default function AppRoutes() { return ( }> } /> } /> } /> } > {menuRoutes.map((route) => ( ))} {extraRoutes && extraRoutes.map((route) => ( ))} } /> ); }