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)

23 lines (22 loc) 1.11 kB
import { jsx as A } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js"; import C from "../Button/hooks/useButton.js"; import { DEFAULT_BUTTON_CLASSNAME as N, BUTTON_ANCHOR_CLASSNAME as B } from "../Button/constants.js"; import { ButtonVariant as h } from "../Button/types.js"; import { useMemo as t } from "../../../external/preact/hooks/dist/hooks.module.js"; import { fixedForwardRef as p } from "../../../utils/preact/fixedForwardRef.js"; import { parseClassName as T } from "../../../utils/preact/className.js"; import { parseBooleanProp as k } from "../../../utils/preact/props.js"; const M = (o, n) => { const { variant: i = h.PRIMARY, disabled: a = !1, onClick: l, classNameModifiers: m = [], className: e } = o, c = t(() => T("", e) || "", [e]), f = t(() => k(a), [a]), { click: r, allChildren: u, allProps: s } = C( c, [...m, i], `${N} ${B}`, f, o, l ), d = t(() => ({ ...s, ...o.onClick && r ? { onClick: r } : {} }), [r, s, o.onClick]); return /* @__PURE__ */ A("a", { ...d, href: o.href, ref: n, children: u }); }, U = p(M); export { U as default };