@adyen/adyen-platform-experience-web
Version:

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