@adyen/adyen-platform-experience-web
Version:

18 lines (17 loc) • 606 B
JavaScript
import { useState as u, useMemo as r, useCallback as f } from "../../../../../../external/preact/hooks/dist/hooks.module.js";
import { RefundMode as m } from "../../types.js";
import { REFUND_REASONS as c } from "../../constants.js";
const E = ({ interactionsDisabled: e, refundMode: o }) => {
const [n, t] = u(c[0]), s = r(
// [TODO]: Remove refund mode check here and use the `refundable` field from `useTransactionRefundMetadata`
() => !e && o !== m.NON_REFUNDABLE,
[e, o]
), R = f(
(a) => void (s && t(a)),
[s]
);
return [n, R];
};
export {
E as useRefundContextReason
};