import { useAPIClient } from "../../api-client/index.mjs";
import { useCollectionField } from "../../data-source/collection-field/CollectionFieldProvider.mjs";
import { useRecord } from "../../record-provider/index.mjs";
import { useCompile } from "../../schema-component/index.mjs";
import { useCollection_deprecated } from "./useCollection_deprecated.mjs";
const useCollectionField_deprecated = ()=>{
    const collection = useCollection_deprecated();
    const record = useRecord();
    const api = useAPIClient();
    const compile = useCompile();
    const ctx = useCollectionField();
    if (!ctx) return {};
    const resourceName = "".concat((null == ctx ? void 0 : ctx.collectionName) || (null == collection ? void 0 : collection.name), ".").concat(ctx.name);
    const resource = null == api ? void 0 : api.resource(resourceName, record[ctx.sourceKey]);
    return {
        ...ctx,
        uiSchema: compile(ctx.uiSchema),
        resource
    };
};
export { useCollectionField_deprecated };
