"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;
}
