import React from "react";
import LoadingPanel from "./LoadingPanel";

interface Loading2Props {
  loaded: boolean;
  children: React.ReactNode;
}

const Loading: React.FC<Loading2Props> = ({ loaded, children }) => {
  if (!loaded) {
    return <LoadingPanel />;
  }

  return <>{children}</>;
};

export default Loading;
