Files
bodyshop/client/src/utils/PhoneFormatter.jsx
Dave Richer 4eb8faa5d9 - the great reformat
Signed-off-by: Dave Richer <dave@imexsystems.ca>
2024-02-06 18:23:46 -05:00

9 lines
301 B
JavaScript

//import NumberFormat from "react-number-format";
import parsePhoneNumber from "libphonenumber-js";
import React from "react";
export default function PhoneNumberFormatter(props) {
const p = parsePhoneNumber(props.children || "", "CA");
return p ? <span>{p.formatNational()}</span> : null;
}