import { t as e } from "../chunks/clsx.js";
import { twMerge as t } from "./helpers/twMerge.js";
import { Icon as n } from "@clubmed/trident-icons";
import { jsx as r, jsxs as i } from "react/jsx-runtime";
//#region lib/ui/Link.tsx
var a = ({ label: a, icon: o, component: s = "a", iconType: c, underlined: l = !0, className: u, inert: d, width: f = "24px", ...p }) => {
	if (!a) return null;
	let m = a.lastIndexOf(" "), h = m === -1 ? a.length : m, g = a.substring(0, 1), _ = a.substring(1, h + 1), v = a.substring(h);
	return /* @__PURE__ */ i(d ? "span" : s, {
		className: t("decoration-none link-container cursor-pointer text-b3 font-semibold", u),
		"data-name": "Link",
		...p,
		children: [/* @__PURE__ */ r("span", {
			className: e({ "link-underline": l }),
			children: g
		}), /* @__PURE__ */ i("span", {
			className: e("hoverable", {
				"has-icon": o,
				"link-underline": l
			}),
			children: [_, /* @__PURE__ */ i("span", {
				className: "inline-block",
				children: [v, o && /* @__PURE__ */ r(n, {
					name: o,
					iconType: c,
					width: f,
					style: { marginInlineStart: "8px" }
				})]
			})]
		})]
	});
};
//#endregion
export { a as Link };

//# sourceMappingURL=Link.js.map