"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IdTableCell = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const table_1 = require("../../components/ui/table");
const tooltip_1 = require("../../components/ui/tooltip");
const lodash_1 = require("lodash");
const lucide_react_1 = require("lucide-react");
const IdTableCell = ({ id, onCopy, ...others }) => {
    const handleCopyToClipboard = () => {
        navigator.clipboard.writeText(id);
        onCopy?.(id);
    };
    return ((0, jsx_runtime_1.jsx)(table_1.TableCell, { onClick: handleCopyToClipboard, ...others, children: (0, jsx_runtime_1.jsxs)(table_1.TableCellWrapper, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { delayDuration: 300, children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { children: (0, lodash_1.truncate)(id, { length: 16 }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { children: id })] }) }), (0, jsx_runtime_1.jsx)(table_1.TableCellAction, { children: (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, { className: "size-3.5" }) })] }) }));
};
exports.IdTableCell = IdTableCell;
