-
-
-
- } />
- } />
-
-
+
+
+
+
+ } />
+ } />
+
+
+
+ }
+ />
+
+
+
+ }
+ />
+
+
+
+ }
+ />
+
+
+
);
}
diff --git a/client/src/components/RequireAuth.tsx b/client/src/components/RequireAuth.tsx
new file mode 100644
index 0000000..3675670
--- /dev/null
+++ b/client/src/components/RequireAuth.tsx
@@ -0,0 +1,10 @@
+import { Navigate } from "react-router-dom";
+import type { ReactNode } from "react";
+import { useAuth } from "../context/AuthContext";
+
+export default function RequireAuth({ children }: { children: ReactNode }) {
+ const { user, loading } = useAuth();
+ if (loading) return null;
+ if (!user) return