- {/* 3 Placeholder Cards */}
+ {/* 4 Placeholder Cards */}
{Array.from(Array(4).keys()).map((_, i) => (
))}
@@ -31,7 +26,6 @@ export const RaceSchedule = () => {
return (
{/* If seasonAom === current/upcomming season, then add button to bring user to next event */}
- {winterTesting &&
}
{/* 10 Placeholder Cards */}
{mainEvents.map((race) => (
@@ -97,39 +91,3 @@ const ResultCard = ({ data }: { data: ScheduleSchema }) => {
);
};
-
-const WinterTesting = ({ data }: { data: ScheduleSchema }) => {
- const eventDate = new Date(data.EventDate);
- const eventPassed = new Date() > eventDate;
-
- return (
-
-
-
-
-
{data.OfficialEventName}
-
- {data.Location}, {data.Country}
-
-
{eventDate.toDateString()}
-
- {eventPassed && (
-
- Testing Results
-
- )}
-
-
- );
-};
diff --git a/src/app/(features)/RaceTimeline.tsx b/src/app/(features)/RaceTimeline.tsx
index f8b7e38..8dbd60f 100644
--- a/src/app/(features)/RaceTimeline.tsx
+++ b/src/app/(features)/RaceTimeline.tsx
@@ -1,7 +1,11 @@
import clsx from 'clsx';
import { BsFillStarFill } from 'react-icons/bs';
-import { fastestLap, formatDuration, positionEnding } from '../../lib/utils';
+import {
+ fastestLap,
+ formatDuration,
+ positionEnding,
+} from '../../utils/helpers';
export const DriverResultsInfo = ({
driver,
diff --git a/src/app/(features)/StandingsTimeline.tsx b/src/app/(features)/StandingsTimeline.tsx
index a201338..862b8e0 100644
--- a/src/app/(features)/StandingsTimeline.tsx
+++ b/src/app/(features)/StandingsTimeline.tsx
@@ -1,6 +1,6 @@
import clsx from 'clsx';
-import { positionEnding } from '../../lib/utils';
+import { positionEnding } from '../../utils/helpers';
export const DriverStandingInfo = ({
driver,
diff --git a/src/app/[season]/[round]/page.tsx b/src/app/[season]/[round]/page.tsx
index 5844a86..678ddd2 100644
--- a/src/app/[season]/[round]/page.tsx
+++ b/src/app/[season]/[round]/page.tsx
@@ -24,7 +24,7 @@ export default function ResultsPage() {
headers={['Drivers', 'Constructors']}
containers={[
- {drivers.map((driver, index, allDrivers) => (
+ {drivers?.map((driver, index, allDrivers) => (
void;
}
@@ -23,17 +23,23 @@ export const Dropdown = ({ value, items, action }: IDropdown) => {
tabIndex={0}
role='button'
className={clsx(
- { 'pointer-events-none opacity-50': items.length <= 0 },
+ { 'pointer-events-none opacity-50': items && items.length <= 1 },
'btn btn-ghost btn-sm rounded-btn underline',
)}
>
- {value}
+ {items ? (
+ <>
+ {value}
+ >
+ ) : (
+
+ )}