2026-02-05 15:28:50 +01:00
|
|
|
import type { NuzlockeRules } from '../types'
|
|
|
|
|
import { RULE_DEFINITIONS } from '../types/rules'
|
|
|
|
|
|
|
|
|
|
interface RuleBadgesProps {
|
|
|
|
|
rules: NuzlockeRules
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function RuleBadges({ rules }: RuleBadgesProps) {
|
|
|
|
|
const enabledRules = RULE_DEFINITIONS.filter((def) => rules[def.key])
|
|
|
|
|
|
|
|
|
|
if (enabledRules.length === 0) {
|
2026-02-17 20:48:42 +01:00
|
|
|
return <span className="text-sm text-text-tertiary">No rules enabled</span>
|
2026-02-05 15:28:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex flex-wrap gap-1.5">
|
|
|
|
|
{enabledRules.map((def) => (
|
|
|
|
|
<span
|
|
|
|
|
key={def.key}
|
|
|
|
|
title={def.description}
|
|
|
|
|
className={`px-2 py-0.5 rounded-full text-xs font-medium ${
|
|
|
|
|
def.category === 'core'
|
2026-02-20 19:45:12 +01:00
|
|
|
? 'bg-blue-900/40 text-blue-300 light:bg-blue-100 light:text-blue-700'
|
2026-02-09 12:24:06 +01:00
|
|
|
: def.category === 'completion'
|
2026-02-20 19:45:12 +01:00
|
|
|
? 'bg-green-900/40 text-green-300 light:bg-green-100 light:text-green-700'
|
|
|
|
|
: 'bg-amber-900/40 text-amber-300 light:bg-amber-100 light:text-amber-800'
|
2026-02-05 15:28:50 +01:00
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
{def.name}
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|