MCPcopy Create free account
hub / github.com/ShipSecAI/studio / getStatusColor

Function getStatusColor

frontend/src/components/timeline/NetworkPanel.tsx:95–103  ·  view source on GitHub ↗
(status?: number, hasError?: boolean)

Source from the content-addressed store, hash-verified

93};
94
95const getStatusColor = (status?: number, hasError?: boolean): string => {
96 if (hasError) return STATUS_COLORS.error;
97 if (!status) return 'text-muted-foreground';
98 if (status >= 200 && status < 300) return STATUS_COLORS['2xx'];
99 if (status >= 300 && status < 400) return STATUS_COLORS['3xx'];
100 if (status >= 400 && status < 500) return STATUS_COLORS['4xx'];
101 if (status >= 500) return STATUS_COLORS['5xx'];
102 return 'text-muted-foreground';
103};
104
105const formatDuration = (ms?: number): string => {
106 if (ms === undefined || ms < 0) return '-';

Callers 2

RequestDetailFunction · 0.70
NetworkPanelFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected