feat(dashboard): tfl err state handling

This commit is contained in:
2025-10-24 23:10:46 +00:00
parent 7b28683e73
commit c90d9655d8

View File

@@ -226,7 +226,24 @@ function TFLTile() {
if (isLoadingTFL) { if (isLoadingTFL) {
return ( return (
<Tile className="col-start-3 h-full row-start-1 col-span-2 row-span-1 flex flex-row justify-start items-center p-8"> <Tile className="col-start-3 h-full row-start-1 col-span-2 row-span-1 flex flex-row justify-start items-center p-8">
<p className="text-2xl font-light animate-pulse">Loading TfL</p> <p className="text-2xl font-light animate-pulse">Loading tube status</p>
</Tile>
)
}
if (errorTFL) {
return (
<Tile className="col-start-3 h-full row-start-1 col-span-2 row-span-1 flex flex-row justify-start items-center p-8">
<p className="text-2xl font-light text-red-400">Error loading from TfL</p>
<p className="text-neutral-400">{errorTFL?.message}</p>
</Tile>
)
}
if (!tflData) {
return (
<Tile className="col-start-3 h-full row-start-1 col-span-2 row-span-1 flex flex-row justify-start items-center p-8">
<p className="text-2xl font-light">No TfL data available</p>
</Tile> </Tile>
) )
} }
@@ -236,7 +253,7 @@ function TFLTile() {
decorations={false} decorations={false}
className="gap-x-1 col-start-3 h-full row-start-1 col-span-2 row-span-1 grid grid-cols-[min-content_1fr] auto-rows-min overflow-y-auto" className="gap-x-1 col-start-3 h-full row-start-1 col-span-2 row-span-1 grid grid-cols-[min-content_1fr] auto-rows-min overflow-y-auto"
> >
{tflData?.goodService.includes("Northern") && ( {tflData.goodService.includes("Northern") && (
<TFLDistruptionItem <TFLDistruptionItem
lineId="northern" lineId="northern"
lineName="Northern" lineName="Northern"
@@ -244,7 +261,7 @@ function TFLTile() {
severity={StatusSeverity.GoodService} severity={StatusSeverity.GoodService}
/> />
)} )}
{tflData?.disruptions.map((disruption) => ( {tflData.disruptions.map((disruption) => (
<Fragment key={disruption.lineId}> <Fragment key={disruption.lineId}>
<TFLDistruptionItem <TFLDistruptionItem
lineId={disruption.lineId} lineId={disruption.lineId}