Display trains that are near a station
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import AutocompleteStop from "./AutocompleteStop"
|
||||
import AutocompleteStation from "./AutocompleteStation"
|
||||
import {useNavigate} from "react-router-dom"
|
||||
|
||||
function Home() {
|
||||
const navigate = useNavigate()
|
||||
|
||||
function onStationSelected(event, stop) {
|
||||
navigate(`/station/sncf/${stop.id}/`)
|
||||
function onStationSelected(event, station) {
|
||||
navigate(`/station/sncf/${station.slug}/`)
|
||||
}
|
||||
|
||||
return <>
|
||||
@ -13,7 +13,7 @@ function Home() {
|
||||
<h2>
|
||||
Choisissez une gare dont vous désirez connaître le tableau des prochains départs et arrivées :
|
||||
</h2>
|
||||
<AutocompleteStop onChange={onStationSelected} />
|
||||
<AutocompleteStation onChange={onStationSelected} />
|
||||
</>
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user