'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var index = require('../../../../utils/index.js');
var Chip = require('../../../Chip/Chip.js');
var dateUtils = require('../../dateUtils.js');
var styles = require('../../styles.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

function Month({ width, height, locale, currentMonth, 'data-testid': dataTestId, updateCurrentMonth, }) {
    const appendTestId = index.getId(dataTestId);
    const onMonthSelect = (month) => {
        updateCurrentMonth(month);
    };
    return (React__default['default'].createElement(styles.PeriodWrapper, { style: { width, height }, "data-testid": dataTestId }, [...Array(12)].map((_, index) => (React__default['default'].createElement(styles.PeriodName, { key: index },
        React__default['default'].createElement(Chip.Chip, { selected: index === currentMonth, onClick: () => onMonthSelect(index), label: dateUtils.getMonthName(index, locale, 'short'), variant: 'ghost', "data-testid": appendTestId(`chip-${index}`) }))))));
}

exports.Month = Month;
