import type { EncounterDetail } from '../types' import { TypeBadge } from './TypeBadge' interface PokemonCardProps { encounter: EncounterDetail showFaintLevel?: boolean onClick?: () => void } export function PokemonCard({ encounter, showFaintLevel, onClick }: PokemonCardProps) { const { pokemon, currentPokemon, route, nickname, catchLevel, faintLevel, deathCause } = encounter const isDead = faintLevel !== null const displayPokemon = currentPokemon ?? pokemon const isEvolved = currentPokemon !== null return (
{displayPokemon.spriteUrl ? ( {displayPokemon.name} ) : (
{displayPokemon.name[0].toUpperCase()}
)}
{nickname || displayPokemon.name}
{nickname && (
{displayPokemon.name}
)}
{displayPokemon.types.map((type) => ( ))}
{showFaintLevel && isDead ? `Lv. ${catchLevel} → ${faintLevel}` : `Lv. ${catchLevel ?? '?'}`}
{route.name}
{isEvolved && (
Originally: {pokemon.name}
)} {isDead && deathCause && (
{deathCause}
)}
) }