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

class BadgeWidget extends StatelessWidget {
  final String badge;
  final IconData? icon; // Optionnel : ajouter une icône au badge

  const BadgeWidget({
    Key? key,
    required this.badge,
    this.icon,
  }) : super(key: key);

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