IO-1536 Add VIN Highlighting.

This commit is contained in:
Patrick Fic
2022-07-14 15:18:01 -07:00
parent b346c28fe0
commit 27ce30527e
6 changed files with 41 additions and 6 deletions

View File

@@ -0,0 +1,18 @@
import React from "react";
export default function VehicleVinDisplay({ children }) {
if (!children) return null;
console.log(children);
if (typeof children !== "string" || children.length !== 17) return children;
const vin = children.trim();
const first = vin.substring(0, 9);
const second = vin.substring(9, 17);
return (
<>
<span>{first}</span>
<span style={{ textDecoration: "underline" }}>{second}</span>
</>
);
}