'use client' import React from 'react' type Mode = 'models' | 'guardrails' interface ToggleOption { key: string label: string subtitle: string } interface Props { mode: Mode onModeChange: (mode: Mode) => void options: ToggleOption[] } const MODE_COLORS: Record = { models: { color: '#BA2FA2', dim: 'rgba(186,47,162,0.07)' }, guardrails: { color: '#00C0F3', dim: 'rgba(0,192,243,0.07)' }, } const TAB_ICONS: Record React.ReactNode> = { models: ({ color }) => ( ), guardrails: ({ color }) => ( ), } const CRITERIA = [ { num: '01', color: '#00C0F3', colorDim: 'rgba(0,192,243,0.10)', title: 'Localised Undesired Content', abbr: 'Refusal Rate', tagline: 'Can the model refuse contextually harmful prompts?', guardrailDetail: 'Scored on: Recall, Precision, F1 · Sub-tests: General, Physics, Career, JD', modes: ['models', 'guardrails'] as Mode[], Icon: ({ color }: { color: string }) => ( ), }, { num: '02', color: '#6366F1', colorDim: 'rgba(99,102,241,0.08)', title: 'RAG Knowledge Robustness', abbr: 'Robustness', tagline: "Does it know what it doesn't know?", guardrailDetail: null, modes: ['models'] as Mode[], Icon: ({ color }: { color: string }) => ( ), }, { num: '03', color: '#BA2FA2', colorDim: 'rgba(186,47,162,0.10)', title: 'Demographic Fairness', abbr: 'Fairness Disparity', tagline: 'Does it produce equitable outputs for all users?', guardrailDetail: null, modes: ['models'] as Mode[], Icon: ({ color }: { color: string }) => ( ), }, ] export default function BenchmarkExplainer({ mode, onModeChange, options }: Props) { const visibleCriteria = CRITERIA.filter(c => c.modes.includes(mode)) return (
{/* Mode switcher — full-width toggle */}
{options.map(o => { const isActive = mode === o.key const { color, dim } = MODE_COLORS[o.key as Mode] const TabIcon = TAB_ICONS[o.key as Mode] return ( ) })}
{/* Criteria rows — keyed by mode to trigger transition */}
{visibleCriteria.map((c, i) => (
{/* Numbered icon badge */}
{c.num}
{/* Content */}
{c.title} {c.abbr}

“{c.tagline}”

{mode === 'guardrails' && c.guardrailDetail && (

{c.guardrailDetail}

)}
))}
{/* CTA */}
Want to understand what the scores mean? Our methodology
) }