"use strict";
/**
 * @desc 提示高亮单元格cell
 * @author 段奥
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = __importDefault(require("react"));
const antd_1 = require("antd");
const icons_1 = require("@ant-design/icons");
const styled_components_1 = __importDefault(require("styled-components"));
const StyledTooltipCell = styled_components_1.default.div `
  width: 100%;
`;
const StyledNumericCell = styled_components_1.default.div `
  width: 100%;
  color: ${props => props.isHighlight ? props.theme.warning : props.theme.text.primary};

  .helper-wrapper {
    display: inline-block;
  }
`;
const StyledTooltip = styled_components_1.default(antd_1.Tooltip) `
  margin: 0 5px;

  color: ${props => props.theme.main};
`;
function TooltipCell(props) {
    const { content, tooltip, isHighlight, node, valueFormatted } = props;
    const isStatisticalItem = node && node.rowPinned;
    return !isStatisticalItem ? (react_1.default.createElement(StyledTooltipCell, null,
        react_1.default.createElement(StyledNumericCell, { isHighlight: isHighlight, className: "ag-numeric-cell", role: "gridcell", unselectable: "on" },
            content,
            tooltip && (react_1.default.createElement("div", { className: "helper-wrapper" },
                react_1.default.createElement(StyledTooltip, { autoAdjustOverflow: true, placement: "topRight", arrowPointAtCenter: true, title: tooltip },
                    react_1.default.createElement(icons_1.QuestionCircleOutlined, null))))))) : (valueFormatted || null);
}
exports.default = TooltipCell;
