Merged in feature/IO-3479-Customer-Phone-Numbers (pull request #2761)

Feature/IO-3479 Customer Phone Numbers
This commit is contained in:
Dave Richer
2025-12-31 00:15:48 +00:00
40 changed files with 283 additions and 77 deletions

View File

@@ -1,7 +1,23 @@
//import NumberFormat from "react-number-format";
import { Typography } from "antd";
import parsePhoneNumber from "libphonenumber-js";
export default function PhoneNumberFormatter(props) {
const p = parsePhoneNumber(props.children || "", "CA");
return p ? <span>{p.formatNational()}</span> : null;
const { Text } = Typography;
export default function PhoneNumberFormatter({ children, type }) {
const p = parsePhoneNumber(children || "", "CA");
if (!p) return null;
const phone = p.formatNational();
return (
<span>
<Text>{phone}</Text>
{type ? (
<>
{" "}
<Text type="secondary">({type})</Text>
</>
) : null}
</span>
);
}