import 'package:flutter/material.dart';
import '../../../core/constants/colors.dart';

class BadgeWidget extends StatelessWidget { // Optionnel : ajouter une icône au badge

  const BadgeWidget({
    required this.badge, super.key,
    this.icon,
  });
  final String badge;
  final IconData? icon;

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
      decoration: BoxDecoration(
        color: AppColors.accentColor.withOpacity(0.2),
        borderRadius: BorderRadius.circular(12),
        border: Border.all(
          color: AppColors.accentColor,
        ),
      ),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          if (icon != null) ...[
            Icon(
              icon,
              color: AppColors.accentColor,
              size: 16,
            ),
            const SizedBox(width: 5),
          ],
          Text(
            badge,
            style: TextStyle(
              color: AppColors.accentColor,
              fontSize: 12,
              fontWeight: FontWeight.bold,
            ),
          ),
        ],
      ),
    );
  }
}
