"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CopyTypography = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const Tooltip_1 = require("../Tooltip");
const classNames_1 = require("../utils/classNames");
const constants_1 = require("./constants");
const styles_1 = require("./styles");
const useLogic_1 = require("./useLogic");
const CopyTypography = (props) => {
    const { handleMouseLeave, handleClick, tooltipTitle, isIconOnLeft, isIconOnRight, restProps, copyPosition, color, showCopyIcon, isOverflow, children, tooltipProps, } = (0, useLogic_1.useLogic)(props);
    const renderIcon = () => ((0, jsx_runtime_1.jsx)(styles_1.StyledCopyIcon, { size: "sm", "$copyPosition": copyPosition, color: color, className: (0, classNames_1.classNames)({
            [constants_1.copyTypographyClassnames.showIconOnHover]: showCopyIcon === 'onHover',
        }) }));
    return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: tooltipTitle, disableInteractive: true, placement: "bottom", ...tooltipProps, children: (0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { onMouseLeave: handleMouseLeave, onClick: handleClick, component: "div", color: color, ...restProps, children: [isIconOnLeft && renderIcon(), (0, jsx_runtime_1.jsx)(styles_1.TypographyWrapper, { className: (0, classNames_1.classNames)({
                        [constants_1.copyTypographyClassnames.overflow]: isOverflow,
                    }), children: children }), isIconOnRight && renderIcon()] }) }));
};
exports.CopyTypography = CopyTypography;
