import { useState } from 'react'; import { config } from '@grafana/runtime'; import { Box, Stack, Tab, TabContent, TabsBar } from '@grafana/ui'; import { AlertingPageWrapper } from '../components/AlertingPageWrapper'; import { isLocalDevEnv } from '../utils/misc'; import { withPageErrorBoundary } from '../withPageErrorBoundary'; import GettingStarted, { WelcomeHeader } from './GettingStarted'; import { getInsightsScenes, insightsIsAvailable } from './Insights'; import { PluginIntegrations } from './PluginIntegrations'; function Home() { const insightsEnabled = (insightsIsAvailable() || isLocalDevEnv()) && Boolean(config.featureToggles.alertingInsights); const [activeTab, setActiveTab] = useState<'insights' | 'overview'>(insightsEnabled ? 'insights' : 'overview'); const insightsScene = getInsightsScenes(); return ( {insightsEnabled && ( setActiveTab('insights')} /> )} setActiveTab('overview')} /> {activeTab === 'insights' && } {activeTab === 'overview' && } ); } export default withPageErrorBoundary(Home);