var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { StyledFont12, StyledFont14 } from 'ui/common';
import { toShortString } from 'utils';
import { Tooltip, Box } from '@chakra-ui/react';
var EllipsisText = function (_a) {
    var className = _a.className, text = _a.text, ellipsis = _a.ellipsis;
    var displayName = ellipsis ? toShortString(text) : text;
    return (_jsx(_Fragment, { children: ellipsis ? (_jsx(Tooltip, __assign({ className: className, hasArrow: true, bg: "#fff", placement: "top", label: _jsx(Box, __assign({ p: "2" }, { children: _jsx(StyledFont12, { children: text }) })) }, { children: _jsx(StyledFont14, { children: displayName }) }))) : (_jsx(StyledFont14, __assign({ className: className }, { children: displayName }))) }));
};
export default EllipsisText;
