import 'package:flutter/material.dart';
import '../theme/app_colors.dart';
import '../theme/app_radius.dart';

class SentimentBadge extends StatelessWidget {
  final String label;
  final int score;

  const SentimentBadge({
    super.key,
    required this.label,
    required this.score,
  });

  @override
  Widget build(BuildContext context) {
    final (icon, bg, fg) = switch (label.toLowerCase()) {
      'bullish' => ('📈', AppColors.successBg, AppColors.successLight),
      'bearish' => ('📉', AppColors.errorBg, AppColors.errorLight),
      'mixed' => ('📊', AppColors.infoBg, AppColors.infoLight),
      _ => ('➖', AppColors.panelLight, AppColors.textTertiary),
    };

    return Container(
      padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
      decoration: BoxDecoration(color: bg, borderRadius: AppRadius.pill),
      child: Row(
        mainAxisSize: MainAxisSize.min,
        children: [
          Text(icon, style: const TextStyle(fontSize: 12)),
          const SizedBox(width: 4),
          Text(
            '$label ($score/100)',
            style: TextStyle(color: fg, fontSize: 11, fontWeight: FontWeight.w600),
          ),
        ],
      ),
    );
  }
}