Files
ipd-shomalhospital-admin-panel/src/components/AuthGuard.tsx
2026-03-26 08:11:29 +03:30

28 lines
558 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use client";
import {useMe} from "@/hooks";
import Loader from "./Loader";
export default function AuthGuard({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const {isLoading} = useMe();
if (isLoading)
return (
<div className="h-screen flex items-center justify-center w-full">
<div className="flex items-center justify-center gap-x-4 mx-auto">
<span>لطفا منتظر بمانید</span>
<span>
<Loader />
</span>
</div>
</div>
);
return children;
}