"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FormGroup = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("@chakra-ui/react");
/**
 * FormGroup component for grouping form elements with labels, error messages, and helper text
 */
const FormGroup = ({ label, isRequired = false, isInvalid = false, errorMessage, helperText, children, ...rest }) => {
    return ((0, jsx_runtime_1.jsxs)(react_1.FormControl, { isRequired: isRequired, isInvalid: isInvalid, mb: 4, ...rest, children: [label && (0, jsx_runtime_1.jsx)(react_1.FormLabel, { children: label }), children, isInvalid && errorMessage && (0, jsx_runtime_1.jsx)(react_1.FormErrorMessage, { children: errorMessage }), helperText && !isInvalid && (0, jsx_runtime_1.jsx)(react_1.FormHelperText, { children: helperText })] }));
};
exports.FormGroup = FormGroup;
exports.default = exports.FormGroup;
//# sourceMappingURL=FormGroup.js.map