import { jsx } from 'react/jsx-runtime';
import Tooltip from '../Tooltip/Tooltip.js';
import { isTextTruncated, truncateText } from '../../utils/truncateText/truncateText.js';

const TruncatedTooltip = ({ title, width, }) => {
    const isTruncated = isTextTruncated(title, width, 'pixel');
    return (jsx(Tooltip, { title: isTruncated ? title : '', style: { cursor: isTruncated ? 'pointer' : 'default' }, children: truncateText(title, width, 'pixel') }));
};

export { TruncatedTooltip as default };
//# sourceMappingURL=TruncatedTooltip.js.map
