-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make Incident Banner * Export Severity type * Add status from status page * Remove unnecessary condition
- Loading branch information
1 parent
89b902a
commit 64734a6
Showing
4 changed files
with
39 additions
and
10 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
ui/apps/dashboard/src/app/(organization-active)/IncidentBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
'use client'; | ||
|
||
import { Link } from '@inngest/components/Link'; | ||
|
||
import { Banner, type Severity } from '@/components/Banner'; | ||
import { useBooleanFlag } from '@/components/FeatureFlags/hooks'; | ||
import { useSystemStatus } from './support/statusPage'; | ||
|
||
export default function IncidentBanner() { | ||
const isIncidentBannerEnabled = useBooleanFlag('incident-banner'); | ||
const status = useSystemStatus(); | ||
|
||
if (!isIncidentBannerEnabled.value && status.indicator === 'none') return; | ||
|
||
let message = ''; | ||
let severity: Severity = 'warning'; | ||
|
||
if (isIncidentBannerEnabled.value) { | ||
message = ' We are experiencing some issues.'; | ||
} else { | ||
message = `${status.description}`; | ||
if (status.indicator === 'minor') { | ||
severity = 'info'; | ||
} | ||
} | ||
|
||
return ( | ||
<Banner kind={severity}> | ||
{message} Please check the{' '} | ||
<span style={{ display: 'inline-flex' }}> | ||
<Link href="https://status.inngest.com/">status page.</Link> | ||
</span> | ||
</Banner> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { Banner } from './Banner'; | ||
export { Banner, type Severity } from './Banner'; |