diff options
Diffstat (limited to 'src/pages/Home.tsx')
| -rw-r--r-- | src/pages/Home.tsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 1f5c319..568b2f0 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -28,6 +28,14 @@ export function Home() { return data?.filter(stop => stop.favourite) ?? [] }, [data]) + const recentStops = useMemo(() => { + const recent = sdp.getRecent(); + + if (recent.length === 0) return null; + + return recent.map(stopId => data?.find(stop => stop.stopId === stopId) as Stop).reverse(); + }, [data]) + if (data === null) return <h1>Loading...</h1> return ( @@ -63,6 +71,18 @@ export function Home() { ))} </ul> + <h2>Recientes</h2> + + <ul> + {recentStops?.map((stop: Stop) => ( + <li key={stop.stopId}> + <Link to={`/${stop.stopId}`}> + ({stop.stopId}) {stop.name} - {stop.lines?.join(', ')} + </Link> + </li> + ))} + </ul> + <h2>Paradas</h2> <ul> |
