chore: remove all .jsx files from Frontend src
Vite resolves .tsx before .jsx (per extensions order in vite.config.ts), so .jsx files were never loaded at runtime. Switching to TSX-only source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
import AppLayout from "@/components/layout/app-layout";
|
||||
import LoadingScreen from "@/components/ui/LoadingScreen";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { Suspense } from "react";
|
||||
import { Redirect, Route } from "wouter";
|
||||
export function ProtectedRoute({ path, component: Component, adminOnly = false, }) {
|
||||
const { user, isLoading } = useAuth();
|
||||
return (<Route path={path}>
|
||||
{isLoading ? (<AppLayout>
|
||||
<LoadingScreen />
|
||||
</AppLayout>) : !user ? (<Redirect to="/auth"/>) : adminOnly && user.username !== "admin" ? (<Redirect to="/insurance-status"/>) : (<AppLayout>
|
||||
<Suspense fallback={<LoadingScreen />}>
|
||||
<Component />
|
||||
</Suspense>
|
||||
</AppLayout>)}
|
||||
</Route>);
|
||||
}
|
||||
Reference in New Issue
Block a user