aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/components/arrivals/ReducedArrivalCard.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/app/components/arrivals/ReducedArrivalCard.tsx')
-rw-r--r--src/frontend/app/components/arrivals/ReducedArrivalCard.tsx27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/frontend/app/components/arrivals/ReducedArrivalCard.tsx b/src/frontend/app/components/arrivals/ReducedArrivalCard.tsx
index 27d97b3..19cc8d9 100644
--- a/src/frontend/app/components/arrivals/ReducedArrivalCard.tsx
+++ b/src/frontend/app/components/arrivals/ReducedArrivalCard.tsx
@@ -15,8 +15,15 @@ export const ReducedArrivalCard: React.FC<ArrivalCardProps> = ({
onClick,
}) => {
const { t } = useTranslation();
- const { route, headsign, estimate, delay, shift, vehicleInformation } =
- arrival;
+ const {
+ route,
+ headsign,
+ estimate,
+ delay,
+ shift,
+ vehicleInformation,
+ operator,
+ } = arrival;
const etaValue = estimate.minutes.toString();
const etaUnit = t("estimates.minutes", "min");
@@ -41,6 +48,13 @@ export const ReducedArrivalCard: React.FC<ArrivalCardProps> = ({
kind?: "regular" | "gps" | "delay" | "warning" | "vehicle";
}> = [];
+ if (operator) {
+ chips.push({
+ label: operator,
+ kind: "regular",
+ });
+ }
+
// Badge/Shift info as a chip
if (headsign.badge) {
chips.push({
@@ -130,7 +144,14 @@ export const ReducedArrivalCard: React.FC<ArrivalCardProps> = ({
}
return chips;
- }, [delay, shift, estimate.precision, headsign.badge, vehicleInformation]);
+ }, [
+ delay,
+ shift,
+ estimate.precision,
+ headsign.badge,
+ vehicleInformation,
+ operator,
+ ]);
const isClickable = !!onClick && estimate.precision !== "past";
const Tag = isClickable ? "button" : "div";