'use client'; import React, { useMemo } from 'react'; // Link not required for hash-only navigation import { FiInfo } from 'react-icons/fi'; import GaugeComponent from '@knowyourdeveloper/react-gauge-component'; import { clampPercent, hexToRgba, scoreToColorHex, red, yellow, green } from '../colors'; export default function RoleOverviewCard({ title, matchLabel, roleName, }: { title: string; matchLabel?: string; roleName?: string; }) { const pct = useMemo(() => { const raw = String(matchLabel || '').toLowerCase(); let mapped = 0; if (raw.includes('optimal')) mapped = 100; else if (raw.includes('strong')) mapped = 75; else if (raw.includes('partial')) mapped = 50; else if (raw.includes('weak')) mapped = 25; else mapped = 0; // incompatible or unknown return clampPercent(mapped); }, [matchLabel]); const headerTint = hexToRgba(scoreToColorHex(pct), 0.06); const displayLabel = String(matchLabel || '').trim(); const tickLabels = useMemo(() => ({ type: 'outer' as const, hideMinMax: true, defaultTickLineConfig: { length: 7, width: 1, distanceFromArc: 3, color: 'var(--icon-button-secondary)' }, defaultTickValueConfig: { style: { fontSize: '10px', fill: 'var(--text-secondary)' } }, ticks: [ { value: 16, valueConfig: { formatTextValue: () => 'Weak' } }, { value: 50, valueConfig: { formatTextValue: () => 'Partial' } }, { value: 83, valueConfig: { formatTextValue: () => 'Strong' } }, ] }), []); return (