certimate/ui/src/pages/AuthLayout.tsx
2025-01-03 20:29:34 +08:00

22 lines
461 B
TypeScript

import { Navigate, Outlet } from "react-router-dom";
import Version from "@/components/Version";
import { getPocketBase } from "@/repository/pocketbase";
const AuthLayout = () => {
const auth = getPocketBase().authStore;
if (auth.isValid && auth.isAdmin) {
return <Navigate to="/" />;
}
return (
<div className="container">
<Outlet />
<Version className="fixed right-8 bottom-4" />
</div>
);
};
export default AuthLayout;