-
-
{departure.destination}
+
+
+
+ {departure.destination}
-
- {timeText}
-
+
{timeText}
);
};
diff --git a/src/components/organisms/DepartureList.tsx b/src/components/organisms/DepartureList.tsx
index 7bf9549..faa2ebe 100644
--- a/src/components/organisms/DepartureList.tsx
+++ b/src/components/organisms/DepartureList.tsx
@@ -2,19 +2,11 @@ import { DepartureItem } from '../molecules/DepartureItem';
import { Departure } from '../../types';
export const DepartureList = ({ departures, loading }: { departures: Departure[]; loading: boolean }) => {
+ if (loading && departures.length === 0) return
Loading...
;
+ if (!loading && departures.length === 0) return
No departures.
;
return (
-
- {loading && departures.length === 0 && (
-
- Fetching departures...
-
- )}
- {!loading && departures.length === 0 && (
-
- No upcoming departures found.
-
- )}
- {departures.slice(0, 5).map((dep, i) => (
+
+ {departures.map((dep, i) => (
))}