@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
17 lines (16 loc) • 1.2 kB
JavaScript
try {
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f32dc33f-d5dc-4011-99e4-a691c2639e53", e._sentryDebugIdIdentifier = "sentry-dbid-f32dc33f-d5dc-4011-99e4-a691c2639e53");
} catch (e) {}
import { r as useLegalEntity, t as ROOT_LE } from "./useLegalEntity-yxi9XhLi.js";
import { t as getLegalEntityCountry } from "./getLegalEntityCountry-C6bSV6sB.js";
import { n as getCapabilityProblems } from "./processCapabilities-DlZY9-Jc.js";
import { useMemo } from "preact/hooks";
//#region src/utils/api/getProblemsForEntity.ts
var useCapabilityProblems = () => {
const { data: rootLegalEntity } = useLegalEntity(ROOT_LE);
return useMemo(() => rootLegalEntity ? getCapabilityProblems(rootLegalEntity, getLegalEntityCountry(rootLegalEntity)) : void 0, [rootLegalEntity]);
};
var getProblemsForEntity = (capabilityProblems, entityType, entityId) => capabilityProblems[entityType]?.[entityId];
//#endregion
export { useCapabilityProblems as n, getProblemsForEntity as t };