import 'package:flutter/material.dart';
import '../../domain/entities/pokemon.dart';

/// Couleur d'affichage associée à un type de Pokémon.
Color typeToColor(PokemonType type) {
  final Map<PokemonType, Color> map = {
    PokemonType.normal: Colors.white,
    PokemonType.fire: Colors.red,
    PokemonType.water: Colors.blue,
    PokemonType.electric: Colors.yellow,
    PokemonType.grass: Colors.green,
    PokemonType.ice: Colors.cyan,
    PokemonType.fighting: Colors.orange,
    PokemonType.poison: Colors.purple,
    PokemonType.ground: Colors.brown,
    PokemonType.flying: Colors.indigo,
    PokemonType.psychic: Colors.pink,
    PokemonType.bug: Colors.lightGreen,
    PokemonType.rock: Colors.grey,
    PokemonType.ghost: Colors.indigo,
    PokemonType.dragon: Colors.indigo,
    PokemonType.dark: Colors.black45,
    PokemonType.steel: Colors.grey.shade600,
    PokemonType.fairy: Colors.pinkAccent,
    PokemonType.unknown: Colors.transparent,
    PokemonType.shadow: Colors.transparent,
  };
  return map[type] ?? Colors.transparent;
}

/// Nom du type avec une majuscule initiale.
String formatedTypeName(PokemonType type) {
  final typeName = type.name;
  return typeName[0].toUpperCase() + typeName.substring(1);
}
