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
};
