-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBadges.tsx
52 lines (48 loc) · 1.22 KB
/
Badges.tsx
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { BadgeProps } from "../types/badges";
export function KernBadge(props: BadgeProps) {
return (
<span
className={`inline-flex items-center rounded px-2 py-0.5 text-xs font-medium ${props.bgColor} ${props.textColor} ${props.border ? "border" : ""}`}
>
<svg
className={`mr-1.5 h-2 w-2 ${props.svgColor}`}
fill="currentColor"
viewBox="0 0 8 8"
>
<circle cx="4" cy="4" r="3" />
</svg>
{props.name}
</span>
);
}
export function ActiveBadge() {
return (
<KernBadge
name="Yes"
bgColor="bg-green-100"
textColor="text-green-800"
svgColor="text-green-400"
/>
);
}
export function InactiveBadge() {
return (
<KernBadge
name="No"
bgColor="bg-red-100"
textColor="text-red-800"
svgColor="text-red-400"
/>
);
}
export function NotApplicableBadge() {
return (
<KernBadge
name="n/a"
bgColor="bg-gray-100"
textColor="text-gray-800"
svgColor="text-gray-400"
border={true}
/>
);
}