aboutsummaryrefslogtreecommitdiff
path: root/src/pages/Estimates.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/Estimates.tsx')
-rw-r--r--src/pages/Estimates.tsx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/pages/Estimates.tsx b/src/pages/Estimates.tsx
index d3b4ced..3f002be 100644
--- a/src/pages/Estimates.tsx
+++ b/src/pages/Estimates.tsx
@@ -23,13 +23,17 @@ interface StopDetails {
export function Estimates(): JSX.Element {
const sdp = new StopDataProvider();
const [data, setData] = useState<StopDetails | null>(null);
+ const [dataDate, setDataDate] = useState<Date | null>(null);
const [favourited, setFavourited] = useState(false);
const params = useParams();
const loadData = () => {
fetch(`/api/GetStopEstimates?id=${params.stopId}`)
.then(r => r.json())
- .then((body: StopDetails) => setData(body));
+ .then((body: StopDetails) => {
+ setData(body);
+ setDataDate(new Date());
+ });
};
useEffect(() => {
@@ -80,17 +84,9 @@ export function Estimates(): JSX.Element {
</h1>
</div>
- <div className="button-group">
- <Link to="/stops" className="button">
- 🔙 Volver al listado de paradas
- </Link>
-
- <button className="button" onClick={loadData}>⬇️ Recargar</button>
- </div>
-
<div className="table-responsive">
<table className="table">
- <caption>Estimaciones de llegadas</caption>
+ <caption>Estimaciones de llegadas a las {dataDate?.toLocaleTimeString()}</caption>
<thead>
<tr>