forked from FlowwStar/FlowStar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstream-status-badge.tsx
More file actions
45 lines (43 loc) · 1.03 KB
/
Copy pathstream-status-badge.tsx
File metadata and controls
45 lines (43 loc) · 1.03 KB
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
import { cn } from '@/lib/utils'
import type { StreamStatus } from '@/types/stream'
const STATUS_STYLES: Record<StreamStatus, { label: string; className: string }> = {
streaming: {
label: 'Streaming',
className: 'bg-primary/10 text-primary',
},
scheduled: {
label: 'Scheduled',
className: 'bg-chart-3/15 text-chart-2',
},
completed: {
label: 'Completed',
className: 'bg-secondary text-muted-foreground',
},
cancelled: {
label: 'Cancelled',
className: 'bg-destructive/15 text-destructive',
},
}
export function StreamStatusBadge({
status,
className,
}: {
status: StreamStatus
className?: string
}) {
const { label, className: styles } = STATUS_STYLES[status]
return (
<span
className={cn(
'inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium',
styles,
className,
)}
>
{status === 'streaming' && (
<span className="size-1.5 animate-pulse rounded-full bg-current" />
)}
{label}
</span>
)
}