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

35 lines (34 loc) • 1.49 kB
JavaScript
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
};