import React from 'react' ; import type { AdvancedSettingsSetup } from 'src/plugins/advanced_settings/public' ; import type { TelemetryPluginSetup } from 'src/plugins/telemetry/public' ; import type { UsageCollectionSetup } from 'src/plugins/usage_collection/public' ; import type { CoreStart , CoreSetup } from 'src/core/public' ; import { telemetryManagementSectionWrapper , TelemetryManagementSectionWrapperProps , } from './components/telemetry_management_section_wrapper' ; export interface TelemetryManagementSectionPluginDepsSetup { telemetry : TelemetryPluginSetup ; advancedSettings : AdvancedSettingsSetup ; usageCollection ? : UsageCollectionSetup ; } export class TelemetryManagementSectionPlugin { public setup ( core , { advancedSettings , telemetry : { telemetryService } , usageCollection , } ) { const ApplicationUsageTrackingProvider = usageCollection ?. components . ApplicationUsageTrackingProvider ?? React . Fragment ; advancedSettings . component . register ( advancedSettings . component . componentType . PAGE_FOOTER_COMPONENT , ( props ) => { return ( < ApplicationUsageTrackingProvider > { telemetryManagementSectionWrapper ( telemetryService ) ( props as TelemetryManagementSectionWrapperProps ) } < /ApplicationUsageTrackingProvider>); } , true ) ; return { } ; } public start ( core ) { } }