Your IP : 216.73.216.1


Current Path : /proc/self/cwd/wp-content/plugins/leadin/scripts/shared/Auth/
Upload File :
Current File : //proc/self/cwd/wp-content/plugins/leadin/scripts/shared/Auth/AuthWrapper.tsx

import React, { Fragment } from 'react';
import useAuth from './useAuth';
import LoadingBlock from '../Common/LoadingBlock';
import ErrorHandler from '../Common/ErrorHandler';

export default function AuthWrapper({ children }: React.PropsWithChildren) {
  const { auth, loading } = useAuth();

  return loading ? (
    <LoadingBlock />
  ) : auth ? (
    <Fragment>{children}</Fragment>
  ) : (
    <ErrorHandler status={401} />
  );
}