From 12ecc97b07093f3cac6567c70ff75d57b429c674 Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Tue, 21 Oct 2025 17:38:01 +0200
Subject: Implement new Santiago region (WIP)

---
 src/frontend/app/components/RegularTable.tsx | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

(limited to 'src/frontend/app/components/RegularTable.tsx')

diff --git a/src/frontend/app/components/RegularTable.tsx b/src/frontend/app/components/RegularTable.tsx
index 8b01410..68b732a 100644
--- a/src/frontend/app/components/RegularTable.tsx
+++ b/src/frontend/app/components/RegularTable.tsx
@@ -1,15 +1,18 @@
 import { useTranslation } from "react-i18next";
 import { type StopDetails } from "../routes/estimates-$id";
 import LineIcon from "./LineIcon";
+import { type RegionConfig } from "../data/RegionConfig";
 
 interface RegularTableProps {
   data: StopDetails;
   dataDate: Date | null;
+  regionConfig: RegionConfig;
 }
 
 export const RegularTable: React.FC<RegularTableProps> = ({
   data,
   dataDate,
+  regionConfig,
 }) => {
   const { t } = useTranslation();
 
@@ -46,7 +49,9 @@ export const RegularTable: React.FC<RegularTableProps> = ({
           <th>{t("estimates.line", "Línea")}</th>
           <th>{t("estimates.route", "Ruta")}</th>
           <th>{t("estimates.arrival", "Llegada")}</th>
-          <th>{t("estimates.distance", "Distancia")}</th>
+          {regionConfig.showMeters && (
+            <th>{t("estimates.distance", "Distancia")}</th>
+          )}
         </tr>
       </thead>
 
@@ -56,7 +61,7 @@ export const RegularTable: React.FC<RegularTableProps> = ({
           .map((estimate, idx) => (
             <tr key={idx}>
               <td>
-                <LineIcon line={estimate.line} />
+                <LineIcon line={estimate.line} region={regionConfig.id} />
               </td>
               <td>{estimate.route}</td>
               <td>
@@ -64,11 +69,13 @@ export const RegularTable: React.FC<RegularTableProps> = ({
                   ? absoluteArrivalTime(estimate.minutes)
                   : `${estimate.minutes} ${t("estimates.minutes", "min")}`}
               </td>
-              <td>
-                {estimate.meters > -1
-                  ? formatDistance(estimate.meters)
-                  : t("estimates.not_available", "No disponible")}
-              </td>
+              {regionConfig.showMeters && (
+                <td>
+                  {estimate.meters > -1
+                    ? formatDistance(estimate.meters)
+                    : t("estimates.not_available", "No disponible")}
+                </td>
+              )}
             </tr>
           ))}
       </tbody>
@@ -76,7 +83,7 @@ export const RegularTable: React.FC<RegularTableProps> = ({
       {data?.estimates.length === 0 && (
         <tfoot>
           <tr>
-            <td colSpan={4}>
+            <td colSpan={regionConfig.showMeters ? 4 : 3}>
               {t("estimates.none", "No hay estimaciones disponibles")}
             </td>
           </tr>
-- 
cgit v1.3

