import { useMemo as o } from "react";
import { u as s } from "./use-editor.CHZsl_Yo.js";
function d(r) {
  const t = s(), a = o(() => !r || !t.datarecords ? null : t.datarecords[r] || null, [r, t.datarecords]), e = o(() => {
    if (!a)
      return null;
    const n = a.schema;
    return n ? typeof n == "string" ? JSON.parse(n) : n : null;
  }, [a]);
  return {
    datarecord: a,
    schema: e,
    isLoading: !1,
    // Vous pouvez ajouter une logique de loading si nécessaire
    error: r && !a ? new Error(`Datarecord ${r} not found`) : null
  };
}
function i() {
  const r = s(), t = o(() => r.datarecords ? Object.values(r.datarecords) : [], [r.datarecords]), a = o(() => t.map((e) => ({
    value: e.id,
    label: e.label
  })), [t]);
  return {
    datarecords: t,
    options: a
  };
}
export {
  d as a,
  i as u
};
//# sourceMappingURL=use-datarecord.Borzix-r.js.map
