/* eslint-disable react/forbid-prop-types */
import React from 'react';
import PropTypes from 'prop-types';
import parse from 'html-react-parser';

import styles from './content-and-custom-module.module.scss';

const ContentAndCustomModule = ({ content = '', CustomComponent, customComponentProps }) => (
  <>
    <div className={styles.contentAndCustomModuleContainer || ''}>
      {content && <div className={styles.contentBox || ''}>{parse(content)}</div>}
      {CustomComponent && (
        <div className={styles.customComponentBox || ''}>
          <CustomComponent {...customComponentProps} />
        </div>
      )}
    </div>
  </>
);

ContentAndCustomModule.propTypes = {
  content: PropTypes.string,
  CustomComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.any]),
  customComponentProps: PropTypes.object,
  styles: PropTypes.shape({}),
};

export default ContentAndCustomModule;
