cleanup 2
continuous-integration/drone/pr Build is failing

This commit is contained in:
2026-07-03 16:49:50 -04:00
parent c327a3905d
commit 6231befaa8
18 changed files with 179 additions and 281 deletions
+17
View File
@@ -0,0 +1,17 @@
import { Navigate } from 'react-router-dom';
import { useAuth } from './AuthContext';
interface AdminRouteProps {
children: React.ReactNode;
}
// Role Guard - Runs behind ProtectedRoute, so auth is already resolved and `user` is populated by the time this renders.
export function AdminRoute({ children }: AdminRouteProps) {
const { user } = useAuth();
if (!user?.is_admin) {
return <Navigate to="/" replace />;
}
return children;
}