Add condition badges for boss Pokemon mechanics
Some checks failed
CI / backend-lint (push) Failing after 9s
CI / actions-lint (push) Failing after 7s
CI / frontend-lint (push) Successful in 21s

Show colored pill badges (Mega, G-Max, D-Max, Tera) on boss Pokemon
in BossDefeatModal and BossTeamPreview. Starter-dependent condition
labels are ignored. Follows EncounterMethodBadge pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 21:17:32 +01:00
parent 7aeddd61da
commit 8f4ee8f239
4 changed files with 61 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
const CONDITION_CONFIG: Record<string, { label: string; color: string }> = {
'Mega Evolution': {
label: 'Mega',
color: 'bg-fuchsia-100 text-fuchsia-800 dark:bg-fuchsia-900/40 dark:text-fuchsia-300',
},
Gigantamax: {
label: 'G-Max',
color: 'bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300',
},
Dynamax: {
label: 'D-Max',
color: 'bg-rose-100 text-rose-800 dark:bg-rose-900/40 dark:text-rose-300',
},
Terastallize: {
label: 'Tera',
color: 'bg-teal-100 text-teal-800 dark:bg-teal-900/40 dark:text-teal-300',
},
}
export function ConditionBadge({
condition,
size = 'sm',
}: {
condition: string | null
size?: 'sm' | 'xs'
}) {
if (!condition) return null
const config = CONDITION_CONFIG[condition]
if (!config) return null
const sizeClass = size === 'xs' ? 'text-[8px] px-1 py-0' : 'text-[9px] px-1.5 py-0.5'
return (
<span className={`${sizeClass} font-medium rounded-full whitespace-nowrap ${config.color}`}>
{config.label}
</span>
)
}