/* eslint-disable react/prop-types */
/* eslint-disable no-case-declarations */
import React from 'react';
import loadable from '@loadable/component';

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

  return <>{Component && <Component />}</>;
}
