"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import * as React from "react";
import { Label } from "@open-mercato/ui/primitives/label";
function DealFormField({ label, fieldId, required, hint, error, children }) {
  const generatedId = React.useId();
  const controlId = fieldId ?? generatedId;
  const control = React.isValidElement(children) ? React.cloneElement(children, { id: controlId }) : children;
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", "data-crud-field-id": fieldId, children: [
    /* @__PURE__ */ jsxs(Label, { htmlFor: controlId, children: [
      label,
      required ? /* @__PURE__ */ jsx("span", { className: "text-destructive", children: " *" }) : null
    ] }),
    control,
    hint ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: hint }) : null,
    error ? /* @__PURE__ */ jsx("p", { className: "text-xs text-status-error-text", children: error }) : null
  ] });
}
var DealFormField_default = DealFormField;
export {
  DealFormField,
  DealFormField_default as default
};
//# sourceMappingURL=DealFormField.js.map
