import { Layout } from "antd";
import { Suspense } from "react";
import SpinContainer from "../Layout/SpinContainer";

export const RenderRouteElement = (route: any) => (
    <Suspense
      fallback={
        <Layout>
          <SpinContainer />
        </Layout>
      }
    >
      {route.header ? (
        <Layout>{route.element}</Layout>
      ) : (
        route.element || <></>
      )}
    </Suspense>
  );
