import type { Language } from "../../validation"; interface LanguageCirclesProps { languages: Language[]; } const MAX_RADIUS = 380; function percentageToThickness(percentage: number): number { return (percentage / 100) * MAX_RADIUS; } export function LanguageCircles({ languages }: LanguageCirclesProps) { const sortedLanguages = [...languages] .sort((a, b) => b.percentage - a.percentage) .slice(0, 5) .reverse(); let cumulativeRadius = 0; return (
{sortedLanguages.map((lang, i) => { const thickness = percentageToThickness(lang.percentage); const contentSize = cumulativeRadius * 2; cumulativeRadius += thickness; return (
); })}
); }