import React from 'react';
import StatisticsItem from './StatisticsItem';
import { st, classes } from './StatisticsWidget.st.css.js';
import { SIZES } from './constants';
class StatisticsWidget extends React.PureComponent {
    constructor() {
        super(...arguments);
        this._renderStat = (stat, key) => {
            const { size, alignItems, isLoading } = this.props;
            return (React.createElement(StatisticsItem, { ...stat, isLoading: isLoading, key: key, size: size, alignItems: alignItems }));
        };
    }
    render() {
        const { dataHook, size } = this.props;
        let { items } = this.props;
        items = items || [];
        if (items.length > 5) {
            console.warn(`${items.length} items were passed in items array. StatisticsWidget will display only the first 5.`);
        }
        const firstFive = items.slice(0, 5);
        return (React.createElement("div", { className: st(classes.root, {
                size,
            }), "data-hook": dataHook }, firstFive.map(this._renderStat)));
    }
}
StatisticsWidget.displayName = 'StatisticsWidget';
StatisticsWidget.defaultProps = {
    size: SIZES.tiny,
};
export default StatisticsWidget;
//# sourceMappingURL=StatisticsWidget.js.map