Added visual indicators for possibly incorrect vehicle alerts. RPS-53
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user