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)

35 lines (34 loc) 1.49 kB
import { jsx as t } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"; import { ButtonActionsLayout as c } from "./types.js"; import { BUTTON_ACTION_CLASSNAME as a, BUTTON_ACTION_CONTAINER_CLASSNAME as d } from "../constants.js"; import { ButtonVariant as o } from "../types.js"; /* empty css */ import { memo as N } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/compat/dist/compat.module.js"; import { useMemo as A } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js"; import f from "classnames"; import p from "../Button.js"; function T({ actions: i, layout: s = c.BUTTONS_END }) { const l = () => `${a}--${s}`, n = (e) => { const r = i.length - 1; return e === r ? o.PRIMARY : o.SECONDARY; }, m = A(() => [...i].reverse(), [i]); return /* @__PURE__ */ t("div", { className: a, children: /* @__PURE__ */ t("div", { className: `${d} ${l()}`, role: "group", children: m.map((e, r) => /* @__PURE__ */ t( p, { className: f(e.classNames), "aria-label": e.ariaLabel ?? e.title, disabled: e.disabled, variant: e.variant || n(r), onClick: e.event, state: e.state ?? "default", iconLeft: e.iconLeft, iconRight: e.iconRight, children: e.renderTitle ? e.renderTitle(e.title) : e.title }, `${r}_${e.title || "0"}` )) }) }); } const R = N(T); export { R as default };