Openstatus www.openstatus.dev

feat: differenciate light incidents (#978)

* feat: differenciate light incidents

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

authored by

Maximilian Kaske
autofix-ci[bot]
and committed by
GitHub
e9782461 d6d12e0a

+19
+18
apps/web/src/components/tracker/tracker.tsx
··· 45 45 false: "", 46 46 true: classNames.degraded, 47 47 }, 48 + incident: { 49 + // only used to highlight incident that are 'light' (less than 10 minutes) 50 + light: classNames.degraded, 51 + }, 48 52 }, 49 53 defaultVariants: { 50 54 variant: "empty", ··· 133 137 }: BarProps) => { 134 138 const [open, setOpen] = React.useState(false); 135 139 140 + // total incident time in ms 141 + const incidentLength = incidents.reduce((prev, curr) => { 142 + return ( 143 + prev + 144 + Math.abs( 145 + (curr.resolvedAt?.getTime() || new Date().getTime()) - 146 + curr.startedAt?.getTime(), 147 + ) 148 + ); 149 + }, 0); 150 + 151 + const isLightIncident = incidentLength > 0 && incidentLength < 600_000; // 10 minutes in ms 152 + 136 153 const rootClassName = tracker({ 137 154 report: statusReports.length > 0, 138 155 variant: blacklist ? "blacklist" : variant, 156 + incident: isLightIncident ? "light" : undefined, 139 157 }); 140 158 141 159 return (
+1
packages/tracker/src/config.ts
··· 39 39 }, 40 40 }; 41 41 42 + // TODO: include more variants especially for the '< 10 min' incidents e.g. 42 43 // REMINDER: add `@openstatus/tracker/src/**/*.ts into tailwindcss content prop */ 43 44 export const classNames: Record<StatusVariant, string> = { 44 45 up: "bg-status-operational/90 data-[state=open]:bg-status-operational border-status-operational",