import { useMemo } from "react";
import { DEFAULT_DATA_SOURCE_KEY } from "./data-source/DataSourceManager.mjs";
const isTitleField = (dm, field)=>{
    var _dm_collectionFieldInterfaceManager_getFieldInterface;
    return !field.isForeignKey && (null == (_dm_collectionFieldInterfaceManager_getFieldInterface = dm.collectionFieldInterfaceManager.getFieldInterface(field.interface)) ? void 0 : _dm_collectionFieldInterfaceManager_getFieldInterface.titleUsable);
};
const useDataSourceHeaders = (dataSource)=>{
    const headers = useMemo(()=>{
        if (dataSource && dataSource !== DEFAULT_DATA_SOURCE_KEY) return {
            'x-data-source': dataSource
        };
    }, [
        dataSource
    ]);
    return headers;
};
export { isTitleField, useDataSourceHeaders };
