Added visual indicators for possibly incorrect vehicle alerts. RPS-53

This commit is contained in:
Patrick Fic
2020-11-19 16:01:06 -08:00
parent 5b8bea3714
commit 6be34ddae6
3 changed files with 57 additions and 10 deletions

View File

@@ -0,0 +1,47 @@
import { AlertFilled } from "@ant-design/icons";
import { Tooltip } from "antd";
import React from "react";
const models = [
"equinox",
"expedition",
"pickup",
"tucson",
"terrain",
"sorento",
"sienna",
"grandcaravan",
"grand caravan",
"journey",
"nv200",
"rav4",
];
export default function VehicleGroupAlertAtom({ job, showGroup = false }) {
const shouldWarn = models.includes(job.v_model.toLowerCase());
const vehicleText = `${job.v_model_yr} ${job.v_makedesc} ${job.v_model} (${
job.v_type
})${
showGroup
? `- ${job.group} @ ${
job.v_age === 1 ? `${job.v_age} year` : `${job.v_age} years`
}`
: ""
}
`;
if (shouldWarn)
return (
<Tooltip title="This vehicle might be in the wrong group. Please confirm the group manually and update it if it is incorrect.">
<div style={{ display: "flex", alignItems: "center" }}>
<span>{vehicleText}</span>
<AlertFilled
style={{ color: "tomato", marginLeft: ".3rem" }}
className="blink_me"
/>
</div>
</Tooltip>
);
return vehicleText;
}