@anoki/fse-ui
Version:
FSE UI components library
101 lines (100 loc) • 4.56 kB
JavaScript
import { j as r } from "./index.es237.js";
import { Avatar as f } from "./index.es28.js";
import { Divider as C } from "./index.es72.js";
import { Button as p } from "./index.es32.js";
import './components/ui/CardDoctor/CardDoctor.css';/* empty css */
import { Row as b } from "./index.es116.js";
import { Col as k } from "./index.es61.js";
const B = ({
titleTag: a = "h2",
doctorName: h,
specialties: d,
contactInfo: m,
schedule: e,
avatar: i,
avatarSize: n = "3",
button: s
}) => {
const x = () => m && (m == null ? void 0 : m.length) > 0, c = () => {
var l;
return e && ((l = e == null ? void 0 : e.days) == null ? void 0 : l.length) > 0;
}, g = () => (s == null ? void 0 : s.label) && (s == null ? void 0 : s.onClick), t = () => x() || c();
return /* @__PURE__ */ r.jsxs("article", { className: "bg-white shadow br-x4 ui-card-doctor", children: [
/* @__PURE__ */ r.jsxs(b, { as: "header", gap: "x16", className: "align-items-center", children: [
i && /* @__PURE__ */ r.jsx(
f,
{
textColor: (i == null ? void 0 : i.textColor) ?? "slate-20",
bg: (i == null ? void 0 : i.bg) ?? "lightblue-a01",
initials: (i == null ? void 0 : i.initials) ?? "",
className: "ui-card-doctor-avatar",
size: n
}
),
/* @__PURE__ */ r.jsxs("div", { children: [
/* @__PURE__ */ r.jsx(a, { className: "fs-5 md-fs-custom-2 fw-semibold text-slate-20", children: h }),
d && (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ r.jsx("p", { className: "fs-6 text-slate-20 fw-regular", children: d == null ? void 0 : d.join(" | ") })
] })
] }),
/* @__PURE__ */ r.jsxs("div", { className: "ui-card-doctor-content", children: [
x() && /* @__PURE__ */ r.jsx("dl", { className: "ui-card-doctor-contact", children: m == null ? void 0 : m.map((l) => /* @__PURE__ */ r.jsxs(
"div",
{
role: "group",
className: "ui-card-doctor-contact-detail",
children: [
/* @__PURE__ */ r.jsx("dt", { className: "fs-custom fw-bold text-slate-28", children: l.label }),
/* @__PURE__ */ r.jsx("dd", { className: "fs-6 fw-regular text-slate-28", children: l.value })
]
},
l.label
)) }),
t() && /* @__PURE__ */ r.jsx(C, { bg: "border-divider" }),
c() && /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsxs("div", { className: "ui-border-lg", children: [
/* @__PURE__ */ r.jsx("h1", { className: "text-align-left fw-bold text-slate-28 mb-x8 fs-custom", children: e == null ? void 0 : e.label }),
/* @__PURE__ */ r.jsx("div", { role: "table", className: "ui-card-doctor-table", children: e == null ? void 0 : e.days.map((l, w) => {
var j;
return /* @__PURE__ */ r.jsxs(
"div",
{
role: "row",
className: "ui-card-doctor-row",
children: [
/* @__PURE__ */ r.jsx(
"div",
{
className: "fs-6 fw-regular text-slate-28",
role: "rowheader",
children: l.label
}
),
/* @__PURE__ */ r.jsxs(
k,
{
role: "cell",
className: "fs-6 fw-regular text-slate-28",
children: [
((j = l == null ? void 0 : l.slots) == null ? void 0 : j.length) === 0 && /* @__PURE__ */ r.jsx("div", { children: /* @__PURE__ */ r.jsx("span", { "aria-hidden": "true", children: "-" }) }),
l.slots.map((o, N) => /* @__PURE__ */ r.jsxs("div", { children: [
/* @__PURE__ */ r.jsx("time", { dateTime: o.from, children: o.from }),
/* @__PURE__ */ r.jsx("span", { "aria-hidden": "true", children: " - " }),
/* @__PURE__ */ r.jsx("time", { dateTime: o.to, children: o.to })
] }, `slot-${N}`))
]
},
`cell-${w}`
)
]
},
l.label
);
}) })
] }) })
] }),
g() && /* @__PURE__ */ r.jsx("footer", { children: /* @__PURE__ */ r.jsx(p, { className: "ui-card-doctor-btn", onClick: s == null ? void 0 : s.onClick, children: s == null ? void 0 : s.label }) })
] });
};
export {
B as CardDoctor
};
//# sourceMappingURL=index.es39.js.map