import { observer } from 'mobx-react-lite' ; import { useCallback } from 'react' ; import { useDataResource } from '@cloudbeaver/core-blocks' ; import { useService } from '@cloudbeaver/core-di' ; import { Translate } from '@cloudbeaver/core-localization' ; import { PermissionsResource , usePermission } from '@cloudbeaver/core-root' ; import { Administration } from '../../Administration/Administration' ; import { AdministrationItemService } from '../../AdministrationItem/AdministrationItemService' ; import { EAdminPermission } from '../../EAdminPermission' ; import { AdministrationScreenService } from '../AdministrationScreenService' ; import { WizardStepper } from './WizardStepper' ; import { WizardTopAppBar } from './WizardTopAppBar/WizardTopAppBar' ; export const ConfigurationWizardScreen = observer ( function ConfigurationWizardScreen ( ) { useDataResource ( ConfigurationWizardScreen , PermissionsResource , undefined ) ; const administrationItemService = useService ( AdministrationItemService ) ; const administrationScreenService = useService ( AdministrationScreenService ) ; const handleSelect = useCallback ( ( item ) => { const route = administrationItemService . getItem ( item , true ) ?. configurationWizardOptions ?. defaultRoute ; administrationScreenService . navigateTo ( item , route ) ; } , [ administrationItemService , administrationScreenService ] ) ; if ( ! usePermission ( EAdminPermission . admin ) ) { return < Translate token = 'root_permission_denied' / > ; } return ( < > < WizardTopAppBar /> < Administration activeScreen = { administrationScreenService . activeScreen } configurationWizard onItemSelect = { handleSelect } > < WizardStepper /> < /Administration> < />); } ) ;