- Updated import statements in `textarea.tsx`, `toggle.tsx`, and `tooltip.tsx` for consistency. - Added missing semicolons and adjusted formatting in `use-mobile.ts` and `use-mobile.tsx`. - Cleaned up `package.json` and `root.json` files by removing unnecessary line breaks. - Simplified `turbo.json` by consolidating array formatting for better readability.
18 lines
403 B
TypeScript
18 lines
403 B
TypeScript
import type { JSX } from "react";
|
|
import { Navigate } from "react-router-dom";
|
|
|
|
import { useIsAuthenticated } from "../hooks";
|
|
|
|
/**
|
|
* Protege una ruta para usuarios autenticados.
|
|
*/
|
|
export const AuthGuard = ({ children }: { children: JSX.Element }) => {
|
|
const isAuthenticated = useIsAuthenticated();
|
|
|
|
if (!isAuthenticated) {
|
|
return <Navigate replace to="/login" />;
|
|
}
|
|
|
|
return children;
|
|
};
|