"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PHXFormLayout = PHXFormLayout;
const tslib_1 = require("tslib");
/* eslint-disable @typescript-eslint/ban-types */
const react_1 = tslib_1.__importDefault(require("react"));
const Input_1 = require("../Input/Input");
const types_1 = require("../types");
const Textarea_1 = require("../Textarea");
function PHXFormLayout({ className, list, numberOfInputInRow, textArea, row }) {
    const numberOfInput = (0, types_1.classNames)(numberOfInputInRow === 1 && 'md:grid-cols-1', numberOfInputInRow === 2 && 'md:grid-cols-2', numberOfInputInRow === 3 && 'md:grid-cols-3', numberOfInputInRow === 4 && 'md:grid-cols-4', numberOfInputInRow === 5 && 'md:grid-cols-5');
    return (react_1.default.createElement("div", { className: className },
        react_1.default.createElement("div", { className: `grid gap-y-3 gap-x-5 ${numberOfInput}` }, list.map((item, index) => (react_1.default.createElement(react_1.default.Fragment, null, textArea ? (react_1.default.createElement("div", { key: index },
            react_1.default.createElement(Textarea_1.PHXTextarea, { rows: row, key: index, label: item.label, register: item.register, helpText: item.helpText, error: item.error, errorMessageCustom: item.errorMessageCustom, errorType: item.errorType, ...item.rest }))) : (react_1.default.createElement("div", { key: index },
            react_1.default.createElement(Input_1.PHXInput, { key: index, label: item.label, register: item.register, helpText: item.helpText, error: item.error, errorMessageCustom: item.errorMessageCustom, errorType: item.errorType, ...item.rest })))))))));
}
//# sourceMappingURL=FormLayout.js.map