import { FormLabelLayout } from "./FormLabelLayout.mjs";
import { Form } from "../Form.mjs";
import { jsx, jsxs } from "react/jsx-runtime";

//#region src/components/Form/layout/FormItemLayout.tsx
const FormItemLayout = ({ label, description, isRequired, info, children, showErrorMessage = true, htmlFor }) => /* @__PURE__ */ jsxs(Form.Item, {
	id: htmlFor,
	className: "flex w-full flex-col gap-2 p-2",
	children: [
		(description || label) && /* @__PURE__ */ jsxs("div", {
			className: "flex flex-col gap-1 p-1 leading-none",
			children: [label && /* @__PURE__ */ jsx(FormLabelLayout, {
				isRequired,
				info,
				htmlFor,
				children: label
			}), description && /* @__PURE__ */ jsx(Form.Description, { children: description })]
		}),
		/* @__PURE__ */ jsx(Form.Control, { children }),
		showErrorMessage && /* @__PURE__ */ jsx(Form.Message, { "data-testid": "error-message" })
	]
});

//#endregion
export { FormItemLayout };
//# sourceMappingURL=FormItemLayout.mjs.map