Merged in release/2025-12-19 (pull request #2762)

Release/2025 12 19
This commit is contained in:
Dave Richer
2025-12-31 00:16:32 +00:00
40 changed files with 281 additions and 74 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>
);
}