"use client"; import { Card } from "@/components/ui/card"; import { BarList } from "@/components/charts"; import { teamLeaderboard, formatCurrency } from "@/lib/crm"; import type { CrmState } from "@/lib/crm"; /** * Ranked team leaderboard: a BarList of every rep's all-time bookings * (Closed-Won $), with their quota attainment shown as the secondary caption. */ export function TeamLeaderboard({ crm }: { crm: CrmState }) { const rows = teamLeaderboard(crm).map((r) => ({ label: r.name, value: r.bookings, secondary: r.quota > 0 ? `${Math.round(r.attainment * 100)}%` : "—", })); return (
Leaderboard
Bookings · attainment
formatCurrency(v)} />
); }