From 5ced7f916d94e86e9a7ec164bee56f9a8e3a2a3a Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Mon, 26 May 2025 10:48:43 +0200 Subject: Replace Azure SWA with custom server --- src/components/GroupedTable.tsx | 74 ----------------------------------------- 1 file changed, 74 deletions(-) delete mode 100644 src/components/GroupedTable.tsx (limited to 'src/components/GroupedTable.tsx') diff --git a/src/components/GroupedTable.tsx b/src/components/GroupedTable.tsx deleted file mode 100644 index 58bb5ed..0000000 --- a/src/components/GroupedTable.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { StopDetails } from "../pages/Estimates"; -import LineIcon from "./LineIcon"; - -interface GroupedTable { - data: StopDetails; - dataDate: Date | null; -} - -export const GroupedTable: React.FC = ({ data, dataDate }) => { - const formatDistance = (meters: number) => { - if (meters > 1024) { - return `${(meters / 1000).toFixed(1)} km`; - } else { - return `${meters} m`; - } - } - - const groupedEstimates = data.estimates.reduce((acc, estimate) => { - if (!acc[estimate.line]) { - acc[estimate.line] = []; - } - acc[estimate.line].push(estimate); - return acc; - }, {} as Record); - - const sortedLines = Object.keys(groupedEstimates).sort((a, b) => { - const firstArrivalA = groupedEstimates[a][0].minutes; - const firstArrivalB = groupedEstimates[b][0].minutes; - return firstArrivalA - firstArrivalB; - }); - - return - - - - - - - - - - - - - {sortedLines.map((line) => ( - groupedEstimates[line].map((estimate, idx) => ( - - {idx === 0 && ( - - )} - - - - - )) - ))} - - - {data?.estimates.length === 0 && ( - - - - - - )} -
Estimaciones de llegadas a las {dataDate?.toLocaleTimeString()}
LĂ­neaRutaLlegadaDistancia
- - {estimate.route}{`${estimate.minutes} min`} - {estimate.meters > -1 - ? formatDistance(estimate.meters) - : "No disponible" - } -
No hay estimaciones disponibles
-} \ No newline at end of file -- cgit v1.3