/* eslint-disable react/prop-types */
/* eslint-disable no-case-declarations */
import React, { lazy, Suspense } from 'react';
// import loadable from '@loadable/component';

export default function index(props) {
  const Component = () => {
    switch (props?.style) {
      case 'template_two':
        const TemplateTwo = lazy(() => import('./template-two'));
        return <TemplateTwo {...props} />;
      case 'template_three':
        const TemplateThree = lazy(() => import('./template-three'));
        return <TemplateThree {...props} />;
      default:
        const TemplateOne = lazy(() => import('./template-one'));
        return <TemplateOne {...props} />;
    }
  };

  return <Suspense fallback={<></>}>{Component && <Component />}</Suspense>;
}
