website refactor
This commit is contained in:
@@ -8,7 +8,7 @@ type UpcomingRace = {
|
||||
id: string;
|
||||
track: string;
|
||||
car: string;
|
||||
scheduledAt: string | Date;
|
||||
formattedDate: string;
|
||||
};
|
||||
|
||||
interface UpcomingRacesSidebarProps {
|
||||
@@ -35,14 +35,12 @@ export function UpcomingRacesSidebar({ races }: UpcomingRacesSidebarProps) {
|
||||
</Stack>
|
||||
<Stack gap={3}>
|
||||
{races.slice(0, 4).map((race) => {
|
||||
const scheduledAt = typeof race.scheduledAt === 'string' ? new Date(race.scheduledAt) : race.scheduledAt;
|
||||
|
||||
return (
|
||||
<RaceSummaryItem
|
||||
key={race.id}
|
||||
track={race.track}
|
||||
meta={race.car}
|
||||
dateLabel={scheduledAt.toLocaleDateString()}
|
||||
dateLabel={race.formattedDate}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user