-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathErrorStatusBadge.tsx
More file actions
34 lines (31 loc) · 745 Bytes
/
ErrorStatusBadge.tsx
File metadata and controls
34 lines (31 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { type ErrorGroupStatus } from "@trigger.dev/database";
import { cn } from "~/utils/cn";
const styles: Record<ErrorGroupStatus, string> = {
UNRESOLVED: "bg-error/10 text-error",
RESOLVED: "bg-success/10 text-success",
IGNORED: "bg-charcoal-750 text-text-dimmed",
};
const labels: Record<ErrorGroupStatus, string> = {
UNRESOLVED: "Unresolved",
RESOLVED: "Resolved",
IGNORED: "Ignored",
};
export function ErrorStatusBadge({
status,
className,
}: {
status: ErrorGroupStatus;
className?: string;
}) {
return (
<span
className={cn(
"inline-flex items-center rounded px-2 py-0.5 text-xs font-medium",
styles[status],
className
)}
>
{labels[status]}
</span>
);
}