UNPKG

@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.

65 lines (64 loc) 2.69 kB
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] = "6f7018b5-7d79-40e8-bf4b-978f3a7b2981", e._sentryDebugIdIdentifier = "sentry-dbid-6f7018b5-7d79-40e8-bf4b-978f3a7b2981"); } catch (e) {} import { i as Typography, r as useTranslation } from "./translation-BFxyJ1c5.js"; import { n as IconButton } from "./Button-oj6H8OrC.js"; import { t as useAnalyticsContext } from "./useAnalyticsContext-BVFDMrVE.js"; import { t as StackLayout } from "./StackLayout-Bhbj68nx.js"; import { t as Header } from "./Header-CPmJyuoP.js"; import { t as List } from "./List-DLrcpMVd.js"; import { t as StructuredList } from "./StructuredList-w0Z2zLTk.js"; import { t as trackNavigation } from "./trackNavigation-LvCP5Vyc.js"; import { jsx, jsxs } from "preact/jsx-runtime"; import { defineSlots } from "named-slots"; var NewSummary_module_default = { "summary-header": "adyen-kyc-summary-header", summaryHeader: "adyen-kyc-summary-header" }; //#endregion //#region src/components/Shared/NewSummary/NewSummary.tsx var NewSummary = ({ children, handleEditForm, sections }) => { const { t } = useTranslation("common"); const { Slot } = defineSlots(children, ["errorPanel", "extraContent"]); const userEvents = useAnalyticsContext(); return /* @__PURE__ */ jsxs("div", { role: "region", children: [/* @__PURE__ */ jsx(Header, { title: t(($) => $["summary"]), description: t(($) => $["summaryDescription"]) }), /* @__PURE__ */ jsxs(StackLayout, { children: [ /* @__PURE__ */ jsx(Slot, { name: "errorPanel" }), sections.map(({ formId, label, items }) => { if (formId === "summary") return; return /* @__PURE__ */ jsxs(List, { variant: "grouped-secondary", children: [/* @__PURE__ */ jsxs("header", { className: NewSummary_module_default.summaryHeader, children: [/* @__PURE__ */ jsx(Typography, { el: "h2", variant: "title", children: label }), /* @__PURE__ */ jsx(IconButton, { variant: "tertiary", icon: "edit", onClick: () => { trackNavigation({ userEvents, actionType: "edit", toForm: label, label: "Pencil icon" }); handleEditForm(formId); }, ariaLabel: t(($) => $["editForm"], { label }) })] }), /* @__PURE__ */ jsx(StructuredList, { items: items ?? [] })] }, formId); }), /* @__PURE__ */ jsx(Slot, { name: "extraContent" }) ] })] }); }; //#endregion export { NewSummary as t };