import React from 'react' ; import { RouteParams } from '../../routes' ; import { usePluginContext } from '../../hooks/use_plugin_context' ; import { OverviewPage as OldOverviewPage } from './old_overview_page' ; import { OverviewPage as NewOverviewPage } from './overview_page' ; export type { BucketSize } from './old_overview_page' ; interface Props { routeParams : RouteParams < '/overview' > ; } export function OverviewPage ( props ) { const { config } = usePluginContext ( ) ; if ( config . unsafe . overviewNext . enabled ) { return < NewOverviewPage { ... props } / > ; } else { return < OldOverviewPage { ... props } / > ; } }