UNPKG

@clubmed/trident-ui

Version:

Shared ClubMed React UI components

51 lines (50 loc) 1.26 kB
import { jsx as r, jsxs as d } from "react/jsx-runtime"; import { c as l } from "../chunks/index.js"; const p = (e = "") => e.split(" ").map((i) => i.slice(0, 1)).join(""); function b({ alt: e, src: i, srcSet: n, style: o, children: f, className: t, ...u }) { return /* @__PURE__ */ r( "div", { ...u, ...i || n ? { role: "figure", "aria-label": e } : {}, className: l( "flex items-center justify-center relative overflow-hidden", { "rounded-full": !(t != null && t.includes("rounded-")), "text-black": !(t != null && t.includes("text-")), "bg-saffron": !(t != null && t.includes("bg-")) }, t ), style: { width: "48px", height: "48px", ...o }, children: /* @__PURE__ */ d("span", { className: "flex items-center justify-center font-bold uppercase text-h6 h-full", children: [ i || n ? /* @__PURE__ */ r( "img", { srcSet: n, src: i, alt: e, className: "w-full h-full object-cover transparent indent-[1000px]" } ) : p(e), f ] }) } ); } export { b as Avatar }; //# sourceMappingURL=Avatar.js.map