'use client'; import { BarChart3 } from 'lucide-react'; const SKILL_LEVELS = [ { id: 'pro', label: 'Pro', icon: BarChart3, color: 'text-yellow-400', bgColor: 'bg-yellow-400/10', borderColor: 'border-yellow-400/30' }, { id: 'advanced', label: 'Advanced', icon: BarChart3, color: 'text-purple-400', bgColor: 'bg-purple-400/10', borderColor: 'border-purple-400/30' }, { id: 'intermediate', label: 'Intermediate', icon: BarChart3, color: 'text-primary-blue', bgColor: 'bg-primary-blue/10', borderColor: 'border-primary-blue/30' }, { id: 'beginner', label: 'Beginner', icon: BarChart3, color: 'text-green-400', bgColor: 'bg-green-400/10', borderColor: 'border-green-400/30' }, ]; interface SkillDistributionProps { drivers: { skillLevel?: string; }[]; } export function SkillDistribution({ drivers }: SkillDistributionProps) { const distribution = SKILL_LEVELS.map((level) => ({ ...level, count: drivers.filter((d) => d.skillLevel === level.id).length, percentage: drivers.length > 0 ? Math.round((drivers.filter((d) => d.skillLevel === level.id).length / drivers.length) * 100) : 0, })); return (

Skill Distribution

Driver population by skill level

{distribution.map((level) => { const Icon = level.icon; return (
{level.count}

{level.label}

{level.percentage}% of drivers

); })}
); }