import 'package:flutter/material.dart';
import 'package:em2rp/models/equipment_model.dart';

/// Widget réutilisable pour afficher un badge de statut d'équipement ou container
class StatusBadge extends StatelessWidget {
  final EquipmentStatus status;
  final double fontSize;
  final EdgeInsets padding;

  const StatusBadge({
    super.key,
    required this.status,
    this.fontSize = 12,
    this.padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: padding,
      decoration: BoxDecoration(
        color: status.color.withOpacity(0.2),
        borderRadius: BorderRadius.circular(12),
        border: Border.all(color: status.color),
      ),
      child: Text(
        status.label,
        style: TextStyle(
          fontSize: fontSize,
          fontWeight: FontWeight.bold,
          color: status.color,
        ),
      ),
    );
  }
}

