website refactor
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import Link from 'next/link';
|
||||
import { ChevronRight, Car, Zap, Trophy, ArrowRight } from 'lucide-react';
|
||||
import { formatTime, getRelativeTime } from '@/lib/utilities/time';
|
||||
import { raceStatusConfig } from '@/lib/utilities/raceStatus';
|
||||
|
||||
interface RaceCardProps {
|
||||
@@ -19,6 +18,7 @@ interface RaceCardProps {
|
||||
}
|
||||
|
||||
export function RaceCard({ race, onClick, className }: RaceCardProps) {
|
||||
const scheduledAtDate = new Date(race.scheduledAt);
|
||||
const config = raceStatusConfig[race.status as keyof typeof raceStatusConfig] || {
|
||||
border: 'border-charcoal-outline',
|
||||
bg: 'bg-charcoal-outline',
|
||||
@@ -41,12 +41,12 @@ export function RaceCard({ race, onClick, className }: RaceCardProps) {
|
||||
{/* Time Column */}
|
||||
<div className="flex-shrink-0 text-center min-w-[60px]">
|
||||
<p className="text-lg font-bold text-white">
|
||||
{formatTime(race.scheduledAt)}
|
||||
{scheduledAtDate.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}
|
||||
</p>
|
||||
<p className={`text-xs ${config.color}`}>
|
||||
{race.status === 'running'
|
||||
? 'LIVE'
|
||||
: getRelativeTime(race.scheduledAt)}
|
||||
: scheduledAtDate.toLocaleDateString()}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user