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)

27 lines (26 loc) 984 B
import { useMemo as u, useEffect as p } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js"; import { useFetch as a } from "../../../../hooks/useFetch.js"; import { useConfigContext as d } from "../../../../core/ConfigContext/preact/context.js"; import { EMPTY_OBJECT as C } from "../../../../utils/value/constants.js"; const T = (t, i, m, f, c) => { const { getPayByLinkSettings: o } = d().endpoints, { data: r, isFetching: n, error: s } = a( u( () => ({ fetchOptions: { enabled: !!o && i && !!t, onSuccess: () => { m(!1), c(!1); } }, queryFn: async () => o?.(C, { path: { storeId: t } }) }), [o, t, i, m, c] ) ), e = u(() => (!r || !r?.termsOfServiceUrl) && !n && !s ? { termsOfServiceUrl: "" } : r, [r, n, s]); return p(() => { f(e); }, [e, f]), { data: e, isFetching: n, error: s }; }; export { T as useStoreTermsAndConditions };