import React from 'react';
import classnames from 'classnames';
import { ExpandedValueTooltip } from '../../../ExpandedValueTooltip';
import { withTableContext } from '../../../HOCs/withTableContext';
import { useClickableChartStyle } from '../../../hooks/useClickableChartStyle';
import { useStyles } from './styles';
export var AttributeCellRenderer = function (_a) {
    var _b = _a.value, value = _b === void 0 ? '' : _b, onClick = _a.onClick;
    var styles = useStyles();
    var clickable = useClickableChartStyle(onClick);
    return (React.createElement(ExpandedValueTooltip, { value: value },
        React.createElement("div", { "data-reltio-id": "attribute-cell-renderer", className: classnames(styles.attribute, clickable), onClick: onClick }, value)));
};
export default withTableContext(function (_a, _b) {
    var onItemClick = _a.onItemClick;
    var group = _b.rowValue.group;
    return {
        onClick: onItemClick &&
            (function () {
                onItemClick(group);
            })
    };
})(AttributeCellRenderer);
