import Link from 'next/link';
import Image from 'next/image';
import { PlaceholderImage } from './PlaceholderImage';
import { Box } from './Box';
import { Text } from './Text';
import { Badge } from './Badge';
export interface DriverIdentityProps {
driver: {
id: string;
name: string;
avatarUrl: string | null;
};
href?: string;
contextLabel?: React.ReactNode;
meta?: React.ReactNode;
size?: 'sm' | 'md';
}
export function DriverIdentity(props: DriverIdentityProps) {
const { driver, href, contextLabel, meta, size = 'md' } = props;
const avatarSize = size === 'sm' ? 40 : 48;
const nameSize = size === 'sm' ? 'sm' : 'base';
const avatarUrl = driver.avatarUrl;
const content = (
{avatarUrl ? (
) : (
)}
{driver.name}
{contextLabel && (
{contextLabel}
)}
{meta && (
{meta}
)}
);
if (href) {
return (
{content}
);
}
return {content};
}