mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
Iterated with translations
This commit is contained in:
18
components/product/price.tsx
Normal file
18
components/product/price.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
const Price = ({
|
||||
amount,
|
||||
currencyCode = 'USD',
|
||||
...props
|
||||
}: {
|
||||
amount: string;
|
||||
currencyCode: string;
|
||||
} & React.ComponentProps<'p'>) => (
|
||||
<p suppressHydrationWarning={true} {...props}>
|
||||
{`${new Intl.NumberFormat(undefined, {
|
||||
style: 'currency',
|
||||
currency: currencyCode,
|
||||
currencyDisplay: 'narrowSymbol'
|
||||
}).format(parseFloat(amount))} ${currencyCode}`}
|
||||
</p>
|
||||
);
|
||||
|
||||
export default Price;
|
Reference in New Issue
Block a user