import { Suspense } from 'react';

import { lazyRetry } from 'src/utils/lazyRetry';

const Article = lazyRetry(() => import('../Article'));

const ArticleRoute = () => (
  <Suspense>
    <Article />
  </Suspense>
);

type ArticleActionRoute = {
  path: string;
  element: JSX.Element;
};

/**
 * @description HuLibraries article actions reused under root and child layouts
 * to avoid duplicating route definitions per action.
 */
export const articleActionRoutes: ArticleActionRoute[] = [
  {
    path: 'edit',
    element: <ArticleRoute />,
  },
];
