import 'package:flutter/material.dart'; /// Small colored dot + label for a device's live status ("online" / /// "offline" / "unknown"), used anywhere a device is listed. class StatusBadge extends StatelessWidget { const StatusBadge({super.key, required this.status}); final String status; @override Widget build(BuildContext context) { final (color, label) = switch (status) { 'online' => (Colors.green, 'онлайн'), 'offline' => (Colors.red, 'офлайн'), _ => (Colors.grey, 'неизвестно'), }; return Row( mainAxisSize: MainAxisSize.min, children: [ Container( width: 8, height: 8, decoration: BoxDecoration(color: color, shape: BoxShape.circle), ), const SizedBox(width: 6), Text(label, style: TextStyle(color: color, fontSize: 12)), ], ); } }