"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderParentCellTooltip = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const constant_1 = require("../constant");
const get_title_by_relationship_code_1 = require("./get-title-by-relationship-code");
const DescriptionListInTooltip_1 = require("../../DescriptionListInTooltip");
const TextV2_1 = require("../../TextV2");
const Box_1 = require("../../Box");
const renderParentCellTooltip = (value) => (react_1.default.createElement("div", null, Array.isArray(value) && value.length > 0 ? (react_1.default.createElement(DescriptionListInTooltip_1.PHXDescriptionListInTooltip, { items: value.map((parent) => ({
        title: (0, get_title_by_relationship_code_1.getTitleByRelationshipCode)(parent === null || parent === void 0 ? void 0 : parent.relationship_code),
        description: parent.full_name,
    })), tooltipClassName: 'max-w-none w-auto min-w-[150px]', trigger: react_1.default.createElement(Box_1.PHXBox, { maxWidth: 'table-cell', widthFitContent: true, borderBottom: 'medium', borderStyle: 'dotted', pb: 'atomic' },
        react_1.default.createElement(TextV2_1.PHXTextV2, { color: 'primary', size: 'caption', isTruncate: true }, value.map((parent) => `${parent.full_name}`).join(', '))) })) : (react_1.default.createElement(Box_1.PHXBox, { maxWidth: 'table-cell', widthFitContent: true, pb: 'atomic' },
    react_1.default.createElement(TextV2_1.PHXTextV2, { color: 'primary', size: 'caption', isTruncate: true }, constant_1.EMPTY_VALUE)))));
exports.renderParentCellTooltip = renderParentCellTooltip;
//# sourceMappingURL=render-parent-cell-tooltip.js.map