UNPKG

alinea

Version:
27 lines (25 loc) 1.02 kB
import "../../chunks/chunk-NZLE2WMY.js"; // src/field/object/ObjectField.view.tsx import { FormRow } from "alinea/dashboard/atoms/FormAtoms"; import { InputForm } from "alinea/dashboard/editor/InputForm"; import { useFieldError, useFieldOptions } from "alinea/dashboard/editor/UseField"; import { InputLabel } from "alinea/dashboard/view/InputLabel"; import { Sink } from "alinea/ui/Sink"; import { IcRoundFeed } from "alinea/ui/icons/IcRoundFeed"; import { jsx } from "react/jsx-runtime"; function ObjectInput({ field }) { const options = useFieldOptions(field); const error = useFieldError(field); return /* @__PURE__ */ jsx(InputLabel, { ...options, error, icon: IcRoundFeed, children: /* @__PURE__ */ jsx(Sink.Root, { children: /* @__PURE__ */ jsx(Sink.Content, { children: /* @__PURE__ */ jsx( FormRow, { field, type: options.fields, readOnly: options.readOnly, children: /* @__PURE__ */ jsx(InputForm, { type: options.fields }) } ) }) }) }); } export { ObjectInput };