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

class RiskLevelChip extends StatelessWidget {
  final int level;

  const RiskLevelChip({super.key, required this.level});

  Color get _color {
    switch (level) {
      case 0: return AppColors.riskL0;
      case 1: return AppColors.riskL1;
      case 2: return AppColors.riskL2;
      case 3: return AppColors.riskL3;
      default: return AppColors.textMuted;
    }
  }

  String get _label {
    switch (level) {
      case 0: return 'L0 Safe';
      case 1: return 'L1 Low';
      case 2: return 'L2 High';
      case 3: return 'L3 Forbidden';
      default: return 'Unknown';
    }
  }

  @override
  Widget build(BuildContext context) {
    return Chip(
      label: Text(_label, style: TextStyle(color: _color, fontSize: 12)),
      backgroundColor: _color.withOpacity(0.1),
      side: BorderSide(color: _color.withOpacity(0.3)),
      padding: EdgeInsets.zero,
      materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
    );
  }
}
