From 340865ad234f974ec4c0afcbfb6ff06f50a11b2f Mon Sep 17 00:00:00 2001
From: Ariel Costas Guerrero <ariel@costas.dev>
Date: Sun, 20 Apr 2025 19:07:29 +0200
Subject: Load stops from local data files

---
 src/pages/StopList.tsx | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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

diff --git a/src/pages/StopList.tsx b/src/pages/StopList.tsx
index 72cccda..449ae84 100644
--- a/src/pages/StopList.tsx
+++ b/src/pages/StopList.tsx
@@ -1,10 +1,8 @@
 import { useEffect, useMemo, useState } from "react";
-import { Stop, StopDataProvider } from "../data/StopDataProvider";
+import StopDataProvider, { Stop } from "../data/StopDataProvider";
 import StopItem from "../components/StopItem";
 import Fuse from "fuse.js";
 
-const sdp = new StopDataProvider();
-
 const placeholders = [
   "Urzaiz",
   "Gran Vía",
@@ -22,7 +20,7 @@ export function StopList() {
 	const [searchResults, setSearchResults] = useState<Stop[] | null>(null);
 
 	useEffect(() => {
-		sdp.getStops().then((stops: Stop[]) => setData(stops))
+		StopDataProvider.getStops().then((stops: Stop[]) => setData(stops))
 	}, []);
 
 	const handleStopSearch = (event: React.ChangeEvent<HTMLInputElement>) => {
@@ -39,7 +37,7 @@ export function StopList() {
 	}, [data])
 
 	const recentStops = useMemo(() => {
-		const recent = sdp.getRecent();
+		const recent = StopDataProvider.getRecent();
 
 		if (recent.length === 0) return null;
 		
-- 
cgit v1.3

