import { Component, Field } from "@contember/binding";
import { formatString } from "./utils.js";
import { jsxDEV } from "react/jsx-dev-runtime";
import { Link } from "../../routing/binding/Link.js";
var _jsxFileName = "/__w/interface/interface/packages/admin/src/components/Auto/AutoLabel.tsx";
const AutoLabel = Component(({
  field,
  createLink
}, env) => {
  const entity = env.getSubTreeNode().entity;
  const humanFieldSchema = entity.fields.get(field);
  const optionLabel = /* @__PURE__ */ jsxDEV(Field, {
    field,
    format: (it) => formatString(humanFieldSchema.type, it)
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 15,
    columnNumber: 23
  }, void 0);
  return createLink ? /* @__PURE__ */ jsxDEV(Link, {
    to: createLink(entity.name),
    children: optionLabel
  }, void 0, false, {
    fileName: _jsxFileName,
    lineNumber: 16,
    columnNumber: 23
  }, void 0) : optionLabel;
});
export {
  AutoLabel
};
//# sourceMappingURL=AutoLabel.js.map
