import React from 'react' ; import type { AdvancedSettingsSetup } from 'src/plugins/advanced_settings/public' ; import type { Space } from '../../common' ; import { AdvancedSettingsSubtitle , AdvancedSettingsTitle } from './components' ; interface SetupDeps { getActiveSpace : ( ) => Promise < Space > ; componentRegistry : AdvancedSettingsSetup [ 'component' ] ; } export class AdvancedSettingsService { public setup ( { getActiveSpace , componentRegistry } ) { const PageTitle = ( ) => < AdvancedSettingsTitle getActiveSpace = { getActiveSpace } />; const SubTitle = ( ) => < AdvancedSettingsSubtitle getActiveSpace = { getActiveSpace } />; componentRegistry . register ( componentRegistry . componentType . PAGE_TITLE_COMPONENT , PageTitle , true ) ; componentRegistry . register ( componentRegistry . componentType . PAGE_SUBTITLE_COMPONENT , SubTitle , true ) ; } }