import 'package:flutter/material.dart';

/// Arrière-plan pour les actions de swipe avec design moderne.
///
/// Ce widget affiche un arrière-plan coloré avec une icône et un label
/// lors d'une action de swipe sur une carte d'événement.
///
/// **Usage:**
/// ```dart
/// SwipeBackground(
///   color: Colors.red,
///   icon: Icons.lock,
///   label: 'Fermer',
/// )
/// ```
class SwipeBackground extends StatelessWidget {
  const SwipeBackground({
    required this.color,
    required this.icon,
    required this.label,
    super.key,
  });

  final Color color;
  final IconData icon;
  final String label;

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: color,
        borderRadius: BorderRadius.circular(16),
      ),
      alignment: Alignment.centerRight,
      padding: const EdgeInsets.symmetric(horizontal: 20),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.end,
        mainAxisSize: MainAxisSize.min,
        children: [
          Icon(
            icon,
            color: Colors.white,
            size: 24,
          ),
          const SizedBox(width: 8),
          Text(
            label,
            style: const TextStyle(
              color: Colors.white,
              fontSize: 14,
              fontWeight: FontWeight.w600,
            ),
          ),
        ],
      ),
    );
  }
}
