"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StyledFormLabel = exports.EditRecordForm = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@chakra-ui/react");
const EditRecordForm = ({ form, formKeys, }) => ((0, jsx_runtime_1.jsx)(FormContainer, { children: formKeys.map(({ key, label, type = "text", required, render }) => render ? (render(form, { key, label, required })) : ((0, jsx_runtime_1.jsxs)(react_1.FormControl, { children: [(0, jsx_runtime_1.jsxs)(exports.StyledFormLabel, { children: [label, " ", required && " *"] }), type === "checkbox" ? ((0, jsx_runtime_1.jsx)(react_1.Checkbox, Object.assign({}, form.register(key, { required }), { defaultChecked: form.getValues(key), size: "lg" }, { children: "Approved" }))) : ((0, jsx_runtime_1.jsx)(FormInput, Object.assign({ type: type }, form.register(key, { required }), { size: "lg" })))] }, key))) }));
exports.EditRecordForm = EditRecordForm;
const FormContainer = (0, react_1.chakra)(react_1.Flex, {
    baseStyle: {
        flexDirection: "column",
        gap: "5px",
    },
});
exports.StyledFormLabel = (0, react_1.chakra)(react_1.FormLabel, {
    baseStyle: {
        fontSize: "sm",
        mt: "8px",
        mb: "4px",
        ml: "0px",
    },
});
const FormInput = (0, react_1.chakra)(react_1.Input, {
    baseStyle: {
        rounded: "lg",
    },
});
//# sourceMappingURL=EditRecordForm.js.map