"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PHXHelpText = void 0;
const tslib_1 = require("tslib");
const Text_1 = require("../Text/Text");
const react_1 = tslib_1.__importDefault(require("react"));
const types_1 = require("../types");
const PHXHelpText = ({ helpText, isHelpTextArray }) => {
    if (!helpText)
        return react_1.default.createElement(react_1.default.Fragment, null);
    const HelpTextComp = ({ title, description }) => (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(Text_1.PHXText, { as: 'div', tone: 'subdued' }, `${title}:`),
        react_1.default.createElement(Text_1.PHXText, { as: 'div' }, description)));
    return (react_1.default.createElement(Text_1.PHXText, { as: 'div', tone: 'subdued' }, isHelpTextArray && (helpText === null || helpText === void 0 ? void 0 : helpText.length) > 0 ? (react_1.default.createElement(react_1.default.Fragment, null, helpText.map((item, index) => (react_1.default.createElement("div", { key: index, className: (0, types_1.classNames)('flex gap-1', index !== 0 && 'mt-1') },
        react_1.default.createElement(HelpTextComp, { title: item.title, description: item.description })))))) : (react_1.default.createElement(react_1.default.Fragment, null, typeof helpText === 'string' ? (helpText) : (react_1.default.createElement("div", { className: 'flex gap-1' },
        react_1.default.createElement(HelpTextComp, { title: helpText.title, description: helpText.description })))))));
};
exports.PHXHelpText = PHXHelpText;
//# sourceMappingURL=HelpText.js.map