@@ -6,14 +6,13 @@ import Tooltip from "@mui/material/Tooltip";
66import type { AuditLog } from "api/typesGenerated" ;
77import { Avatar } from "components/Avatar/Avatar" ;
88import { DropdownArrow } from "components/DropdownArrow/DropdownArrow" ;
9- import { Pill } from "components/Pill/Pill" ;
109import { Stack } from "components/Stack/Stack" ;
10+ import { StatusPill } from "components/StatusPill/StatusPill" ;
1111import { TimelineEntry } from "components/Timeline/TimelineEntry" ;
1212import { InfoIcon } from "lucide-react" ;
1313import { NetworkIcon } from "lucide-react" ;
1414import { type FC , useState } from "react" ;
1515import { Link as RouterLink } from "react-router-dom" ;
16- import type { ThemeRole } from "theme/roles" ;
1716import userAgentParser from "ua-parser-js" ;
1817import { AuditLogDescription } from "./AuditLogDescription/AuditLogDescription" ;
1918import { AuditLogDiff } from "./AuditLogDiff/AuditLogDiff" ;
@@ -22,21 +21,6 @@ import {
2221determineIdPSyncMappingDiff ,
2322} from "./AuditLogDiff/auditUtils" ;
2423
25- const httpStatusColor = ( httpStatus :number ) :ThemeRole => {
26- // Treat server errors (500) as errors
27- if ( httpStatus >= 500 ) {
28- return "error" ;
29- }
30-
31- // Treat client errors (400) as warnings
32- if ( httpStatus >= 400 ) {
33- return "warning" ;
34- }
35-
36- // OK (200) and redirects (300) are successful
37- return "success" ;
38- } ;
39-
4024interface AuditLogRowProps {
4125auditLog :AuditLog ;
4226// Useful for Storybook
@@ -139,7 +123,7 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
139123</ Stack >
140124
141125< Stack direction = "row" alignItems = "center" >
142- < StatusPill code = { auditLog . status_code } />
126+ < StatusPill isHttpCode = { true } code = { auditLog . status_code } />
143127
144128{ /* With multi-org, there is not enough space so show
145129 everything in a tooltip. */ }
@@ -243,19 +227,6 @@ export const AuditLogRow: FC<AuditLogRowProps> = ({
243227) ;
244228} ;
245229
246- function StatusPill ( { code} :{ code :number } ) {
247- const isHttp = code >= 100 ;
248-
249- return (
250- < Pill
251- css = { styles . statusCodePill }
252- type = { isHttp ?httpStatusColor ( code ) :code === 0 ?"success" :"error" }
253- >
254- { code . toString ( ) }
255- </ Pill >
256- ) ;
257- }
258-
259230const styles = {
260231auditLogCell :{
261232padding :"0 !important" ,
@@ -311,14 +282,6 @@ const styles = {
311282width :"100%" ,
312283} ,
313284
314- statusCodePill :{
315- fontSize :10 ,
316- height :20 ,
317- paddingLeft :10 ,
318- paddingRight :10 ,
319- fontWeight :600 ,
320- } ,
321-
322285deletedLabel :( theme ) => ( {
323286...( theme . typography . caption as CSSObject ) ,
324287color :theme . palette . text . secondary ,