diff --git a/apps/dashboard/src/App.tsx b/apps/dashboard/src/App.tsx index fb05fc6..6a51fbb 100644 --- a/apps/dashboard/src/App.tsx +++ b/apps/dashboard/src/App.tsx @@ -1,9 +1,9 @@ import { useQuery } from "@tanstack/react-query" import Chart from "chart.js/auto" -import { Fragment, useEffect, useLayoutEffect, useRef, useState } from "react" +import { useEffect, useLayoutEffect, useRef, useState } from "react" import { beszelSystemsQuery } from "./beszel" import cn from "./components/lib/cn" -import { StatusSeverity, formatLineName, tflDisruptionsQuery } from "./tfl" +import { StatusSeverity, TubeLine, formatLineName, tflDisruptionsQuery } from "./tfl" import { DEFAULT_LATITUDE, DEFAULT_LONGITUDE, @@ -15,31 +15,27 @@ import { function App() { return ( -
{formattedDate}
-{formattedTime}
+{formattedDate}
+{formattedTime}
{temperature}°
@@ -187,7 +183,7 @@ function WeatherTile() { className={cn( "w-4", index >= highlightIndexStart - ? "bg-teal-400 w-8 h-[2px]" + ? "bg-teal-500 dark:bg-teal-400 w-8 h-[2px]" : "bg-neutral-400 w-4 h-[1px]", )} /> @@ -209,7 +205,16 @@ function WeatherTile() { ) } -function TFLTile() { +function TFLTile({ className }: { className?: string }) { + const linesIDontCareAbout = [ + TubeLine.WaterlooCity, + TubeLine.Windrush, + TubeLine.Lioness, + TubeLine.Lioness, + TubeLine.Tram, + TubeLine.Mildmay, + ] + const { data: tflData, isLoading: isLoadingTFL, @@ -222,6 +227,7 @@ function TFLTile() { if (b.lineName.match(/northern/i)) return 1 return a.statusSeverity - b.statusSeverity }) + data.disruptions = data.disruptions.filter((disruption) => !linesIDontCareAbout.includes(disruption.lineId)) return data }, refetchInterval: 5 * 60 * 1000, // 5 minutes @@ -230,7 +236,9 @@ function TFLTile() { if (isLoadingTFL) { return ( -Loading tube status
Error loading from TfL
{errorTFL?.message}
No TfL data available
+
{lineName}
@@ -470,17 +487,14 @@ function SystemTile({
if (!beszelSystemsData) {
return (
- No system status available {displayName}