import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE__block_provider_BlockProvider_mjs__ from "../../../../../block-provider/BlockProvider.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_collection_record_CollectionRecordProvider_mjs__ from "../../../../../data-source/collection-record/CollectionRecordProvider.mjs";
function useDetailsDecoratorProps(props) {
    const params = (0, __WEBPACK_EXTERNAL_MODULE__block_provider_BlockProvider_mjs__.useParamsFromRecord)();
    let parentRecord;
    if (props.association) parentRecord = useDetailsParentRecord(props.association);
    return {
        params,
        parentRecord
    };
}
function useDetailsParentRecord(association) {
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const recordData = (0, __WEBPACK_EXTERNAL_MODULE__data_source_collection_record_CollectionRecordProvider_mjs__.useCollectionRecordData)();
    const parentRecordData = (0, __WEBPACK_EXTERNAL_MODULE__data_source_collection_record_CollectionRecordProvider_mjs__.useCollectionParentRecordData)();
    if (!association) return;
    if (fieldSchema['x-is-current']) return parentRecordData;
    return recordData;
}
export { useDetailsDecoratorProps, useDetailsParentRecord };
