19 lines
457 B
JavaScript
19 lines
457 B
JavaScript
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>
|
|
</>
|
|
);
|
|
}
|