'use client'; import { cn } from '@/lib/utils'; import { useTranslation } from '@/lib/i18n'; import type { DeviceStatus } from '@/types/device'; const statusColors: Record = { detected: 'bg-gray-400', connecting: 'bg-yellow-400', connected: 'bg-green-500', flashing: 'bg-yellow-500', inferencing: 'bg-blue-500', error: 'bg-red-500', disconnected: 'bg-gray-400', }; export function DeviceStatusBadge({ status }: { status: DeviceStatus }) { const { t } = useTranslation(); const statusLabels: Record = { detected: t('devices.status.detected'), connecting: t('devices.status.connecting'), connected: t('devices.status.connected'), flashing: t('devices.status.flashing'), inferencing: t('devices.status.inferencing'), error: t('devices.status.error'), disconnected: t('devices.status.disconnected'), }; const color = statusColors[status] || statusColors.disconnected; const label = statusLabels[status] || statusLabels.disconnected; return (
{label}
); }