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) 606 B
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 };