2024-05-11 18:52:22 +00:00
|
|
|
import AutocompleteStation from "./AutocompleteStation"
|
2024-02-02 23:52:52 +00:00
|
|
|
import {useNavigate} from "react-router-dom"
|
|
|
|
|
|
|
|
function Home() {
|
|
|
|
const navigate = useNavigate()
|
|
|
|
|
2024-05-11 18:52:22 +00:00
|
|
|
function onStationSelected(event, station) {
|
|
|
|
navigate(`/station/sncf/${station.slug}/`)
|
2024-02-02 23:52:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return <>
|
2024-05-09 17:43:59 +00:00
|
|
|
<h1>Horaires des trains</h1>
|
2024-02-02 23:52:52 +00:00
|
|
|
<h2>
|
|
|
|
Choisissez une gare dont vous désirez connaître le tableau des prochains départs et arrivées :
|
|
|
|
</h2>
|
2024-05-11 18:52:22 +00:00
|
|
|
<AutocompleteStation onChange={onStationSelected} />
|
2024-02-02 23:52:52 +00:00
|
|
|
</>
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Home;
|