import { teamColor } from '../utils' import '../styles/h2h.css' export interface TeammateH2HProps { teamName: string teamColour: string driverATla: string driverBTla: string winsA: number winsB: number /** e.g. "+1" when more than two drivers share the team. */ extraNote?: string } export function TeammateH2H({ teamName, teamColour, driverATla, driverBTla, winsA, winsB, extraNote, }: TeammateH2HProps) { const total = winsA + winsB || 1 const pctA = (winsA / total) * 100 const color = teamColor(teamColour) return (
{teamName} {extraNote ? {extraNote} : null}
{driverATla}
{winsA}–{winsB}
{driverBTla}
) }