"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChartLegend = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
var styles_1 = require("./styles");
var ChartLegend = function (_a) {
    var payload = _a.payload, alignRight = _a.alignRight;
    var isTwoCols = payload.length > 8;
    var styles = (0, styles_1.useStyles)();
    return (react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.wrapper, { isTwoCols: isTwoCols, alignRight: alignRight }) }, payload.map(function (item) { return (react_1.default.createElement("div", { key: item.id, className: styles.item },
        react_1.default.createElement("div", { style: { background: item.color }, className: styles.itemColor }),
        react_1.default.createElement("span", { className: styles.value }, item.value))); })));
};
exports.ChartLegend = ChartLegend;
