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_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__ from "../../../api-client/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../../schema-component/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__MenuItemsProvider_mjs__ from "./MenuItemsProvider.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__PermisionProvider_mjs__ from "./PermisionProvider.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schemas_roles_mjs__ from "./schemas/roles.mjs";
const AvailableActionsContext = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react__.createContext)([]);
AvailableActionsContext.displayName = 'AvailableActionsContext';
const AvailableActionsProver = (props)=>{
    const { data, loading } = (0, __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useRequest)({
        resource: 'availableActions',
        action: 'list'
    });
    if (loading) return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Spin, {});
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(AvailableActionsContext.Provider, {
        value: null == data ? void 0 : data.data,
        children: props.children
    });
};
const useAvailableActions = ()=>(0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(AvailableActionsContext);
const RoleTable = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.SchemaComponentContext.Provider, {
            value: {
                designable: false
            },
            children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(AvailableActionsProver, {
                children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.SchemaComponent, {
                    schema: __WEBPACK_EXTERNAL_MODULE__schemas_roles_mjs__.roleSchema,
                    components: {
                        MenuItemsProvider: __WEBPACK_EXTERNAL_MODULE__MenuItemsProvider_mjs__.MenuItemsProvider,
                        SettingCenterPermissionProvider: __WEBPACK_EXTERNAL_MODULE__PermisionProvider_mjs__.SettingCenterPermissionProvider,
                        PermissionProvider: __WEBPACK_EXTERNAL_MODULE__PermisionProvider_mjs__.PermissionProvider
                    }
                })
            })
        })
    });
export { RoleTable, useAvailableActions };
