/**
 * @desc 提示高亮单元格cell
 * @author 段奥
 */
import React from 'react';
import { Tooltip } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import styled from 'styled-components';
const StyledTooltipCell = styled.div `
  width: 100%;
`;
const StyledNumericCell = styled.div `
  width: 100%;
  color: ${props => props.isHighlight ? props.theme.warning : props.theme.text.primary};

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

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