function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import React from 'react';
import DocsTabsViewer from '@zohodesk/docs/es/docsviewer/DocsTabsViewer';
import Yearview from '../Yearview';
import YearviewDocConfig from './Yearview.model.docConfig';
import componentGroups from '../../../../docs-utils/componentGroups';
import componentCategories from '../../../../docs-utils/componentCategories';
export class YearviewConsumer extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      year: 2021,
      month: 7
    };
    this.setYear = this.setYear.bind(this);
    this.setMonth = this.setMonth.bind(this);
  }

  setYear(year) {
    this.setState({
      year: year
    });
  }

  setMonth(month) {
    this.setState({
      month: month
    });
  }

  render() {
    return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Yearview, _extends({
      viewedYear: this.state.year,
      viewedMonth: this.state.month,
      onSelectYear: this.setYear,
      onSelectMonth: this.setMonth
    }, this.props)));
  }

}
export default function Yearview__Model(props) {
  return /*#__PURE__*/React.createElement(DocsTabsViewer, _extends({
    docConfig: YearviewDocConfig,
    componentType: YearviewConsumer
  }, props));
}

if (false) {
  Yearview__Model.docs = {
    componentGroup: componentGroups.Components,
    folderName: componentCategories.UCL
  };
}