function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

import React from 'react';
import PropTypes from 'prop-types';
import InputDate from '../InputDate';
import './style.css';

var DateRange = function (_React$Component) {
  _inherits(DateRange, _React$Component);

  function DateRange(props) {
    _classCallCheck(this, DateRange);

    var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));

    _this.state = {};
    return _this;
  }

  DateRange.prototype.render = function render() {
    return React.createElement(
      'div',
      { className: 'ma__date-range' },
      React.createElement(
        'fieldset',
        null,
        React.createElement(
          'legend',
          { className: 'ma__date-range__label' },
          this.props.label
        ),
        React.createElement(
          'div',
          { className: 'ma__date-range__start js-filter-by-date-range__start' },
          React.createElement(InputDate, this.props.startDate)
        ),
        React.createElement(
          'div',
          { className: 'ma__date-range__divider' },
          'to'
        ),
        React.createElement(
          'div',
          { className: 'ma__date-range__end js-filter-by-date-range__end' },
          React.createElement(InputDate, this.props.endDate)
        )
      )
    );
  };

  return DateRange;
}(React.Component);

DateRange.propTypes = process.env.NODE_ENV !== "production" ? {
  /** The text label of the date range input */
  label: PropTypes.string.isRequired,
  /** The start date of your filter query, @forms/InputDate */
  startDate: PropTypes.shape(InputDate.props).isRequired,
  /** The end date of your filter query, @forms/InputDate */
  endDate: PropTypes.shape(InputDate.props).isRequired
} : {};

export default DateRange;