From a68ba30716062b265f85c4be078a736c7135d7bc Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Sun, 30 Nov 2025 20:49:48 +0100
Subject: Refactor StopMap and Settings components; replace region config usage
 with REGION_DATA, update StopDataProvider calls, and improve UI elements.
 Remove unused timetable files and add Tailwind CSS support.

---
 src/frontend/app/contexts/SettingsContext.tsx | 46 +++------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

(limited to 'src/frontend/app/contexts/SettingsContext.tsx')

diff --git a/src/frontend/app/contexts/SettingsContext.tsx b/src/frontend/app/contexts/SettingsContext.tsx
index a273008..5f6ff46 100644
--- a/src/frontend/app/contexts/SettingsContext.tsx
+++ b/src/frontend/app/contexts/SettingsContext.tsx
@@ -1,16 +1,11 @@
 import {
-    createContext,
-    useContext,
-    useEffect,
-    useState,
-    type ReactNode,
+  createContext,
+  useContext,
+  useEffect,
+  useState,
+  type ReactNode,
 } from "react";
 import { APP_CONFIG } from "../config/AppConfig";
-import {
-    DEFAULT_REGION,
-    isValidRegion,
-    type RegionId
-} from "../config/RegionConfig";
 
 export type Theme = "light" | "dark" | "system";
 export type TableStyle = "regular" | "grouped" | "experimental_consolidated";
@@ -21,15 +16,8 @@ interface SettingsContextProps {
   setTheme: React.Dispatch<React.SetStateAction<Theme>>;
   toggleTheme: () => void;
 
-  tableStyle: TableStyle;
-  setTableStyle: React.Dispatch<React.SetStateAction<TableStyle>>;
-  toggleTableStyle: () => void;
-
   mapPositionMode: MapPositionMode;
   setMapPositionMode: (mode: MapPositionMode) => void;
-
-  region: RegionId;
-  setRegion: (region: RegionId) => void;
   resolvedTheme: "light" | "dark";
 }
 
@@ -151,38 +139,14 @@ export const SettingsProvider = ({ children }: { children: ReactNode }) => {
   }, [mapPositionMode]);
   //#endregion
 
-  //#region Region
-  const [region, setRegionState] = useState<RegionId>(() => {
-    const savedRegion = localStorage.getItem("region");
-    if (savedRegion && isValidRegion(savedRegion)) {
-      return savedRegion;
-    }
-    return DEFAULT_REGION;
-  });
-
-  const setRegion = (newRegion: RegionId) => {
-    setRegionState(newRegion);
-    localStorage.setItem("region", newRegion);
-  };
-
-  useEffect(() => {
-    localStorage.setItem("region", region);
-  }, [region]);
-  //#endregion
-
   return (
     <SettingsContext.Provider
       value={{
         theme,
         setTheme,
         toggleTheme,
-        tableStyle,
-        setTableStyle,
-        toggleTableStyle,
         mapPositionMode,
         setMapPositionMode,
-        region,
-        setRegion,
         resolvedTheme,
       }}
     >
-- 
cgit v1.3

