UNPKG

@clubmed/trident-ui

Version:

Shared ClubMed React UI components

59 lines (58 loc) 1.5 kB
import { jsxs as t, jsx as o } from "react/jsx-runtime"; import { c as a } from "../chunks/index.js"; import { Icon as u } from "../atoms/Icons/Icon.js"; import "@clubmed/trident-icons"; const C = ({ label: n, icon: s, component: c = "a", iconType: m, underlined: e = !0, className: l, inert: p, ...d }) => { const r = n.lastIndexOf(" "), i = r === -1 ? n.length : r, h = n.substring(0, 1), x = n.substring(1, i + 1), g = n.substring(i); return /* @__PURE__ */ t( p ? "span" : c, { className: a( "text-b3 decoration-none link-container cursor-pointer text-inherit", l ), "data-name": "Link", ...d, children: [ /* @__PURE__ */ o("span", { className: a({ "link-underline": e }), children: h }), /* @__PURE__ */ t( "span", { className: a("hoverable", { "has-icon": s, "link-underline": e }), children: [ x, /* @__PURE__ */ t("span", { className: "inline-block", children: [ g, s && /* @__PURE__ */ o( u, { name: s, iconType: m, width: "24px", style: { marginInlineStart: "8px" } } ) ] }) ] } ) ] } ); }; export { C as Link }; //# sourceMappingURL=Link.js.map