Files
vps-tracker/apps/web/src/components/status-badge.tsx
T
DenozordecandCursor 31a4798d78
Docker / build (push) Has been cancelled
fix(web): привести UI к правилам ReUI — фильтры, badge, токены
Подключены DateSelector и number-field в VPS-фильтры, semantic StatusBadge, --focus токены и переименование DataGridColumn.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 23:37:30 +07:00

23 lines
615 B
TypeScript

import type { ComponentProps } from 'react'
import { Badge } from '@/components/reui/badge'
type BadgeVariant = NonNullable<ComponentProps<typeof Badge>['variant']>
const STATUS_VARIANT: Record<string, BadgeVariant> = {
active: 'success',
ok: 'success',
paid: 'success',
paused: 'secondary',
archived: 'outline',
error: 'destructive',
running: 'info',
overdue: 'warning',
stale: 'warning',
}
export function StatusBadge({ status, label }: { status: string; label?: string }) {
const variant = STATUS_VARIANT[status] ?? 'outline'
return <Badge variant={variant}>{label ?? status}</Badge>
}