mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-09 05:59:50 +00:00
22 lines
461 B
TypeScript
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;
|