import { jsxDEV } from "react/jsx-dev-runtime";
import { Component, Field } from "@contember/binding";
import { formatString } from "./utils.js";
import { Link } from "../../routing/binding/Link.js";
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: "/__w/interface/interface/packages/admin/src/components/Auto/AutoLabel.tsx",
      lineNumber: 18,
      columnNumber: 23
    }, globalThis);
    return createLink ? /* @__PURE__ */ jsxDEV(Link, { to: createLink(entity.name), children: optionLabel }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/Auto/AutoLabel.tsx",
      lineNumber: 19,
      columnNumber: 23
    }, globalThis) : optionLabel;
  }
);
export {
  AutoLabel
};
//# sourceMappingURL=AutoLabel.js.map
