"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PHXDescriptionListInTooltip = PHXDescriptionListInTooltip;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const types_1 = require("../types");
const ToolTip_1 = tslib_1.__importDefault(require("../ToolTip/ToolTip"));
function PHXDescriptionListInTooltip({ items, trigger, type = 'default', tooltipClassName, singleColumn = false, }) {
    return (react_1.default.createElement(ToolTip_1.default, { content: react_1.default.createElement("div", { className: (0, types_1.classNames)('min-w-[200px] whitespace-normal bg-white px-2 py-2', type === 'border' && 'rounded-lg border border-gray-200 shadow-sm', tooltipClassName) }, singleColumn ? (react_1.default.createElement("div", { className: 'flex flex-col gap-y-3' }, items.map((item, index) => (react_1.default.createElement("div", { key: index, className: (0, types_1.classNames)('flex flex-col gap-y-1', item.className) },
            item.title && (react_1.default.createElement("dt", { className: (0, types_1.classNames)('text-[13px] leading-5 text-gray-600', item.titleClassName) }, item.title)),
            item.description && (react_1.default.createElement("dd", { className: (0, types_1.classNames)('whitespace-normal break-words text-[13px] font-medium leading-5 text-gray-800', item.descriptionClassName) }, item.description))))))) : (react_1.default.createElement("div", { className: 'grid grid-cols-[max-content_1fr] gap-x-4 gap-y-1' }, items.map((item, index) => (react_1.default.createElement(react_1.default.Fragment, null,
            react_1.default.createElement("div", { key: index, className: (0, types_1.classNames)('contents', item.className) },
                react_1.default.createElement("dt", { className: (0, types_1.classNames)('whitespace-nowrap text-[13px] leading-5 text-gray-600', item.titleClassName) }, item.title),
                react_1.default.createElement("dd", { className: (0, types_1.classNames)('whitespace-normal break-words text-[13px] font-medium leading-5 text-gray-800', item.descriptionClassName) }, item.description || '')),
            (item === null || item === void 0 ? void 0 : item.isShowDivider) && react_1.default.createElement("div", { className: 'col-span-2 my-1 border-b border-gray-200' }))))))), contentClassName: 'max-w-[24rem]' }, trigger));
}
//# sourceMappingURL=DescriptionListInTooltip.js.map