import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__ from "../../hooks/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__components_index_mjs__ from "../components/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__SchemaSettingsDefaults_mjs__ from "../SchemaSettingsDefaults.mjs";
function useSchemaSettingsRender(name, options) {
    const app = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useApp)();
    const schemaSetting = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>app.schemaSettingsManager.get(name), [
        app.schemaSettingsManager,
        name
    ]);
    if (!name) return {
        exists: false,
        render: ()=>null
    };
    if (!schemaSetting) {
        console.error('[tachybase]: SchemaSettings "'.concat(name, '" not found'));
        return {
            exists: false,
            render: ()=>null
        };
    }
    return {
        exists: true,
        render: function() {
            let options2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
            const newItems = [
                ...__WEBPACK_EXTERNAL_MODULE__SchemaSettingsDefaults_mjs__.defaultSettingItems,
                ...schemaSetting.options.items
            ];
            const newOptions = {
                ...schemaSetting.options,
                items: newItems
            };
            return /*#__PURE__*/ __WEBPACK_EXTERNAL_MODULE_react__["default"].createElement(__WEBPACK_EXTERNAL_MODULE__components_index_mjs__.SchemaSettingsWrapper, {
                ...newOptions,
                ...options,
                ...options2
            });
        }
    };
}
export { useSchemaSettingsRender };
