All files / applications/go-by-transit/src/view/lineDetail/component AlertsCard.tsx

50% Statements 1/2
100% Branches 2/2
50% Functions 1/2
50% Lines 1/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                  2x            
import React from "react";
import { StopAlertsCard, type StopAlertsCardProps } from "@overworld/ui/alerts";
import { getAlertsForStop } from "../../../api/trimet/alertScopes";
import RouteIndicator from "../../../component/route/RouteIndicator";
import Loading from "../../loading/Loading";
 
type Props = Omit<StopAlertsCardProps, "loadingContent" | "renderRouteIndicator"> & { stopId: number };
 
export function AlertsCard({ alertsData, stopId, ...props }: Props) {
  return <StopAlertsCard {...props}
    alertsData={alertsData === undefined ? undefined : getAlertsForStop(alertsData, stopId)}
    loadingContent={<Loading />}
    renderRouteIndicator={id => <RouteIndicator routeId={id} />}
  />;
}