import React from 'react'; import { Box } from './Box'; import { Image } from './Image'; import { Link } from './Link'; import { PlaceholderImage } from './PlaceholderImage'; import { Stack } from './Stack'; import { Text } from './Text'; interface DriverSummaryPillProps { name: string; avatarSrc?: string | null; rating?: number | null; rank?: number | null; onClick?: () => void; href?: string; ratingComponent?: React.ReactNode; } export function DriverSummaryPill({ name, avatarSrc, onClick, href, ratingComponent, }: DriverSummaryPillProps) { const content = ( <> {avatarSrc ? ( {name} ) : ( )} {name} {ratingComponent} ); if (href) { return ( {content} ); } if (onClick) { return ( {content} ); } return ( {content} ); }