import React from 'react';
import ComparisonTable from '../../atoms/cards/comparison-table';
import SrcollLayout from './template-two';
import GridLayout from './template-one';

export default function index({ module, page }) {
  const Component = () => {
    switch (module?.style) {
      case 'comparison_table': {
        if (module.cards_page_type === 'operator') {
          return <ComparisonTable module={module} page={page} />;
        }
        return null;
      }
      case 'template_two': {
        return <SrcollLayout module={module} page={page} />;
      }
      default: {
        return <GridLayout module={module} page={page} />;
      }
    }
  };
  return <>{Component && <Component />}</>;
}
