UNPKG

@clubmed/trident-ui

Version:

Shared ClubMed React UI components

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