import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__ from "../../data-source/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
const CollectionTitle = ()=>{
    const { dataSourceKey = 'main', collectionName } = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollectionRecordData)();
    const dataSourceManager = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useDataSourceManager)();
    const compile = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useCompile)();
    const [title1, title2] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>{
        const dataSource = dataSourceManager.getDataSource(dataSourceKey);
        if (dataSource) {
            const collection = dataSource.collectionManager.getCollection(collectionName);
            return [
                dataSource.displayName,
                (null == collection ? void 0 : collection.title) || collectionName
            ];
        }
        return [
            dataSourceKey,
            null
        ];
    }, [
        dataSourceManager,
        dataSourceKey,
        collectionName
    ]);
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
        children: [
            compile(title1),
            " ",
            '>',
            " ",
            compile(title2)
        ]
    });
};
export { CollectionTitle };
