UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

18 lines (17 loc) 997 B
import { useMemo as t } from "../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js"; import d from "../../../hooks/useTimezoneAwareDateFormatting.js"; import { getPaymentMethodType as A, getDisplayablePaymentMethod as M } from "./utils.js"; import h from "../../../core/Context/preact/useCoreContext.js"; import { DATE_FORMAT_TRANSACTION_DETAILS as l } from "../../../constants/dateFormats.js"; const P = ({ timezone: a, paymentMethodData: n, bankAccount: m, amountData: o, createdAt: e }) => { const r = t(() => ({ paymentMethod: n, bankAccount: m }), [n, m]), { i18n: s } = h(), { dateFormat: u } = d(a), c = t(() => { if (o) { const { currency: p, value: f } = o; return `${s.amount(f, p, { hideCurrency: !0 })} ${p}`; } }, [o, s]), i = t(() => A(r), [r]), y = t(() => M(r), [r]), T = t(() => e && u(e, l), [e, u]); return { amount: c, date: e, formattedDate: T, paymentMethod: y, paymentMethodType: i }; }; export { P as default };