/* eslint-disable react/jsx-props-no-spreading */
import React from 'react';
import PropTypes from 'prop-types';

const Element = ({
  attributes,
  children,
  element
}) => {
  switch (element.type) {
    case 'ul_list':
      return /*#__PURE__*/React.createElement("ul", attributes, children);

    case 'ol_list':
      return /*#__PURE__*/React.createElement("ol", attributes, children);

    case 'heading_one':
      return /*#__PURE__*/React.createElement("h1", attributes, children);

    case 'heading_two':
      return /*#__PURE__*/React.createElement("h2", attributes, children);

    case 'heading_three':
      return /*#__PURE__*/React.createElement("h3", attributes, children);

    case 'heading_four':
      return /*#__PURE__*/React.createElement("h4", attributes, children);

    case 'list_item':
      return /*#__PURE__*/React.createElement("li", attributes, children);

    case 'thematic_break':
      return /*#__PURE__*/React.createElement("div", attributes, /*#__PURE__*/React.createElement("hr", null), children);

    default:
      return /*#__PURE__*/React.createElement("p", attributes, children);
  }
};

Element.propTypes = {
  attributes: PropTypes.object,
  children: PropTypes.node,
  element: PropTypes.shape({
    type: PropTypes.string
  }).isRequired
};
Element.defaultProps = {
  attributes: {},
  children: null
};
export default Element;