"use client";
import Loader from "@/components/loader";

import { useMounted } from "@/hooks/use-mounted";
import React from "react";

const MountedProvider = ({ children, isProtected }: { children: React.ReactNode, isProtected: Boolean }) => {
  const mounted = useMounted();
  if (!mounted) return isProtected ? <Loader /> : null;
  return children;
};

export default MountedProvider;
