diff --git a/frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelSupport.tsx b/frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelSupport.tsx index e0fa379eee969..8e1f876631057 100644 --- a/frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelSupport.tsx +++ b/frontend/src/layout/navigation-3000/sidepanel/panels/SidePanelSupport.tsx @@ -1,7 +1,7 @@ import { useActions, useValues } from 'kea' import React from 'react' -import { IconFeatures, IconHelmet, IconMap } from '@posthog/icons' +import { IconFeatures, IconHelmet, IconMap, IconWarning } from '@posthog/icons' import { LemonButton, Link } from '@posthog/lemon-ui' import { SupportForm } from 'lib/components/Support/SupportForm' @@ -20,6 +20,8 @@ import { AvailableFeature, BillingFeatureType, BillingPlan, BillingType, SidePan import { SidePanelPaneHeader } from '../components/SidePanelPaneHeader' import { sidePanelLogic } from '../sidePanelLogic' +import { sidePanelStatusIncidentIoLogic } from './sidePanelStatusIncidentIoLogic' +import { sidePanelStatusLogic } from './sidePanelStatusLogic' const Section = ({ title, children }: { title: string; children: React.ReactNode }): React.ReactElement => { return ( @@ -32,6 +34,59 @@ const Section = ({ title, children }: { title: string; children: React.ReactNode ) } +const StatusPageAlert = (): JSX.Element | null => { + const { featureFlags } = useValues(featureFlagLogic) + const useIncidentIo = !!featureFlags[FEATURE_FLAGS.INCIDENT_IO_STATUS_PAGE] + const { openSidePanel } = useActions(sidePanelLogic) + + const { status: atlassianStatus, statusPage } = useValues(sidePanelStatusLogic) + const { status: incidentIoStatus, statusDescription: incidentIoDescription } = + useValues(sidePanelStatusIncidentIoLogic) + + const status = useIncidentIo ? incidentIoStatus : atlassianStatus + + if (status === 'operational') { + return null + } + + const description = useIncidentIo ? incidentIoDescription : statusPage?.status.description || 'Active incident' + + const severityClass = status.includes('outage') + ? 'bg-danger-highlight border-danger' + : 'bg-warning-highlight border-warning' + + return ( +
+ openSidePanel(SidePanelTab.Status)} + > + {description} + +
+We're aware of an issue that may be affecting your PostHog experience.
++ You may wish to check our{' '} + openSidePanel(SidePanelTab.Status)} + > + current status + {' '} + before contacting support. +
+Can't find what you need and PostHog AI unable to help?