fix: currency for event types (#10792)

Co-authored-by: Joe Au-Yeung <[email protected]>
This commit is contained in:
alannncandJoe Au-Yeung authored and GitHub committed 2023-08-16 14:58:28 -07:00
1 parent f0dcfc83c8
commit 053da1ec32
3 files changed
+23 -3

No files matched your search

+19 -1
View File
@@ -93,7 +93,7 @@ const querySchema = z.object({
});
export default function Success(props: SuccessProps) {
const { t } = useLocale();
const { t, i18n } = useLocale();
const router = useRouter();
const routerQuery = useRouterQuery();
const pathname = usePathname();
@@ -478,6 +478,21 @@ export default function Success(props: SuccessProps) {
</div>
</>
)}
{props.paymentStatus && (
<>
<div className="mt-3 font-medium">
{props.paymentStatus.paymentOption === "HOLD"
? t("complete_your_booking")
: t("payment")}
</div>
<div className="col-span-2 mb-2 mt-3">
{new Intl.NumberFormat(i18n.language, {
style: "currency",
currency: props.paymentStatus.currency,
}).format(props.paymentStatus.amount / 100.0)}
</div>
</>
)}
{bookingInfo?.description && (
<>
<div className="mt-9 font-medium">{t("additional_notes")}</div>
@@ -1115,6 +1130,9 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
select: {
success: true,
refunded: true,
currency: true,
amount: true,
paymentOption: true,
},
});