SpoolBuddyStatusBar.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { useTranslation } from 'react-i18next';
  2. import { Scale, Nfc } from 'lucide-react';
  3. interface SpoolBuddyStatusBarProps {
  4. weightGrams: number | null;
  5. stable: boolean;
  6. nfcOk: boolean;
  7. deviceOnline: boolean;
  8. }
  9. export function SpoolBuddyStatusBar({ weightGrams, stable, nfcOk, deviceOnline }: SpoolBuddyStatusBarProps) {
  10. const { t } = useTranslation();
  11. return (
  12. <div className="h-[40px] bg-bg-secondary border-t border-bambu-dark-tertiary flex items-center px-4 text-[13px]">
  13. <div className="flex items-center gap-4 flex-1">
  14. <div className="flex items-center gap-2">
  15. <Scale size={14} className="text-text-secondary" />
  16. <span className="text-text-primary font-mono">
  17. {weightGrams !== null ? `${weightGrams.toFixed(1)}g` : '---'}
  18. </span>
  19. {weightGrams !== null && (
  20. <span className={`w-2 h-2 rounded-full ${stable ? 'bg-green-500' : 'bg-yellow-500 animate-pulse'}`} />
  21. )}
  22. </div>
  23. <div className="flex items-center gap-2">
  24. <Nfc size={14} className="text-text-secondary" />
  25. <span className={nfcOk ? 'text-green-500' : 'text-text-muted'}>
  26. {nfcOk ? t('spoolbuddy.status.nfcReady') : t('spoolbuddy.status.nfcOff')}
  27. </span>
  28. </div>
  29. {!deviceOnline && (
  30. <span className="text-red-400 text-[12px]">{t('spoolbuddy.status.offline')}</span>
  31. )}
  32. </div>
  33. <span className="text-text-muted text-[12px]">SpoolBuddy</span>
  34. </div>
  35. );
  36. }