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