import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';

const propTypes = {
  children: PropTypes.node.isRequired,
  className: PropTypes.string,
  defaultClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
  tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
};

const defaultProps = {
  className: '',
  defaultClassName: 'sui-o-modal__content',
  tag: 'div',
};

export const ModalContent = ({
  children, className, defaultClassName, tag: Tag,
}) => (
  <Tag className={classnames(defaultClassName, className)}>
    {children}
  </Tag>
);

ModalContent.propTypes = propTypes;
ModalContent.defaultProps = defaultProps;
