import React from "react";
import { YearsContainer, YearItem } from "../styles";
var Years = function (_a) {
    var data = _a.data, changeYear = _a.changeYear;
    var handleOnClick = function (isDisabled, name) {
        if (isDisabled) {
            return;
        }
        changeYear(parseInt(name, 10));
    };
    return (React.createElement(YearsContainer, null, data.map(function (_a) {
        var id = _a.id, name = _a.name, isActive = _a.isActive, isDisabled = _a.isDisabled;
        return (React.createElement(YearItem, { key: id, isActive: isActive, isDisabled: isDisabled, onClick: function () { return handleOnClick(isDisabled, name); } }, name));
    })));
};
export default Years;
