website refactor
This commit is contained in:
@@ -5,9 +5,16 @@ import { Icon } from '@/ui/Icon';
|
||||
import { Link } from '@/ui/Link';
|
||||
import { Text } from '@/ui/Text';
|
||||
import { RaceCard, RaceTimeColumn, RaceInfo } from '@/ui/RaceCard';
|
||||
import { Car, Trophy, Zap, ArrowRight } from 'lucide-react';
|
||||
import { Car, Trophy, Zap, ArrowRight, Clock, PlayCircle, CheckCircle2, XCircle, HelpCircle } from 'lucide-react';
|
||||
import React from 'react';
|
||||
import { LucideIcon } from 'lucide-react';
|
||||
|
||||
const ICON_MAP = {
|
||||
Clock,
|
||||
PlayCircle,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
HelpCircle,
|
||||
};
|
||||
|
||||
interface RaceListItemProps {
|
||||
track: string;
|
||||
@@ -17,15 +24,13 @@ interface RaceListItemProps {
|
||||
dateLabel?: string;
|
||||
dayLabel?: string;
|
||||
status: string;
|
||||
statusLabel: string;
|
||||
statusVariant: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
||||
statusIconName: string;
|
||||
leagueName?: string | null;
|
||||
leagueHref?: string;
|
||||
strengthOfField?: number | null;
|
||||
onClick: () => void;
|
||||
statusConfig: {
|
||||
icon: LucideIcon;
|
||||
variant: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
|
||||
label: string;
|
||||
};
|
||||
}
|
||||
|
||||
export function RaceListItem({
|
||||
@@ -36,13 +41,16 @@ export function RaceListItem({
|
||||
dateLabel,
|
||||
dayLabel,
|
||||
status,
|
||||
statusLabel,
|
||||
statusVariant,
|
||||
statusIconName,
|
||||
leagueName,
|
||||
leagueHref,
|
||||
strengthOfField,
|
||||
onClick,
|
||||
statusConfig,
|
||||
}: RaceListItemProps) {
|
||||
const isLive = status === 'running';
|
||||
const StatusIcon = ICON_MAP[statusIconName as keyof typeof ICON_MAP] || HelpCircle;
|
||||
|
||||
return (
|
||||
<RaceCard onClick={onClick} isLive={isLive}>
|
||||
@@ -59,9 +67,9 @@ export function RaceListItem({
|
||||
title={track}
|
||||
subtitle={car}
|
||||
badge={
|
||||
<Badge variant={statusConfig.variant}>
|
||||
<Icon icon={statusConfig.icon} size={3.5} />
|
||||
{statusConfig.label}
|
||||
<Badge variant={statusVariant}>
|
||||
<Icon icon={StatusIcon} size={3.5} />
|
||||
{statusLabel}
|
||||
</Badge>
|
||||
}
|
||||
meta={
|
||||
|
||||
Reference in New Issue
Block a user