import { cn as e } from "../../lib/utils.js";
import { ArrayController as t } from "./ArrayController.js";
import { FormElementHeader as n } from "./FormElementHeader.js";
import { InputController as r } from "./InputController.js";
import { ObjectController as i } from "./ObjectController.js";
import "react";
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
//#region src/components/dynamic-form/FormElement.tsx
var c = (c) => {
	let { schema: l, disabled: u } = c, d = l, f = !!d?.hidden, p = d.type, m = Array.isArray(p) ? p.filter((e) => e !== "null").shift() : p;
	return /* @__PURE__ */ o("div", {
		className: e(f ? "hidden" : "block"),
		children: (() => {
			switch (m) {
				case "object": return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(n, {
					title: d.title,
					disabled: u
				}), /* @__PURE__ */ o(i, { ...c })] });
				case "array": return /* @__PURE__ */ o(a, { children: /* @__PURE__ */ o("div", {
					className: "mt-1",
					children: /* @__PURE__ */ o(t, { ...c })
				}) });
				default: return /* @__PURE__ */ o(r, {
					...c,
					name: c.name ?? ""
				});
			}
		})()
	});
};
//#endregion
export { c as FormElement };
