From e4a737f43e45f02e80c06346cea73756f83854f3 Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com>
Date: Mon, 3 Mar 2025 21:13:28 +0100
Subject: Implement map page

---
 src/pages/Estimates.tsx | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

(limited to 'src/pages/Estimates.tsx')

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>
-- 
cgit v1.3

