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

var Heading = function Heading(props) {
  var Element = 'h' + props.level;
  return React.createElement(
    Element,
    { className: props.class },
    props.text
  );
};

Heading.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The heading text  */
  text: PropTypes.string.isRequired,
  /** The heading level */
  level: PropTypes.number,
  /** A passable heading classname */
  class: PropTypes.string
} : {};

Heading.defaultProps = {
  level: 1
};

export default Heading;