-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add facets to alerts table (#2396)
Co-authored-by: Kirill Chernakov <[email protected]> Co-authored-by: Tal <[email protected]>
- Loading branch information
1 parent
56aa378
commit a6a2999
Showing
9 changed files
with
728 additions
and
114 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import clsx from "clsx"; | ||
import { Severity } from "./models"; | ||
|
||
export function AlertSeverityBorder({ | ||
severity, | ||
}: { | ||
severity: Severity | undefined; | ||
}) { | ||
const getSeverityBgClassName = (severity?: Severity) => { | ||
switch (severity) { | ||
case "critical": | ||
return "bg-red-500"; | ||
case "high": | ||
case "error": | ||
return "bg-orange-500"; | ||
case "warning": | ||
return "bg-yellow-500"; | ||
case "info": | ||
return "bg-blue-500"; | ||
default: | ||
return "bg-emerald-500"; | ||
} | ||
}; | ||
|
||
return ( | ||
<div | ||
className={clsx( | ||
"absolute w-1 h-full top-0 left-0", | ||
getSeverityBgClassName(severity) | ||
)} | ||
aria-label={severity} | ||
/> | ||
); | ||
} |
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
Oops, something went wrong.