export function formatEvolutionMethod(evo: { trigger: string; minLevel: number | null; item: string | null; heldItem: string | null; condition: string | null }): string {
  const parts: string[] = []
  if (evo.trigger === 'level-up' && evo.minLevel) {
    parts.push(`Level ${evo.minLevel}`)
  } else if (evo.trigger === 'level-up') {
    parts.push('Level up')
  } else if (evo.trigger === 'use-item' && evo.item) {
    parts.push(evo.item.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()))
  } else if (evo.trigger === 'trade') {
    parts.push('Trade')
  } else {
    parts.push(evo.trigger.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()))
  }
  if (evo.heldItem) {
    parts.push(`holding ${evo.heldItem.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase())}`)
  }
  if (evo.condition) {
    parts.push(evo.condition)
  }
  return parts.join(', ')
}
