import type { NuzlockeRules } from '../types' import { RULE_DEFINITIONS } from '../types/rules' import { TypeBadge } from './TypeBadge' interface RuleBadgesProps { rules: NuzlockeRules } export function RuleBadges({ rules }: RuleBadgesProps) { const enabledRules = RULE_DEFINITIONS.filter((def) => rules[def.key]) const allowedTypes = rules.allowedTypes ?? [] if (enabledRules.length === 0 && allowedTypes.length === 0) { return No rules enabled } return (
{enabledRules.map((def) => ( {def.name} ))} {allowedTypes.length > 0 && ( t.charAt(0).toUpperCase() + t.slice(1)).join(', ')}`} className="px-2 py-0.5 rounded-full text-xs font-medium bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-700 flex items-center gap-1" > Type Restriction {allowedTypes.map((t) => ( ))} )}
) }