UNPKG

@anoki/fse-marche-ui

Version:

FSE UI components library

92 lines (91 loc) 4.25 kB
import { j as r } from "./index.es137.js"; import { Avatar as f } from "./index.es56.js"; import { Divider as t } from "./index.es153.js"; import { Button as C } from "./index.es25.js"; import './components/ui/CardDoctor/CardDoctor.css';/* empty css */ import { Row as p } from "./index.es9.js"; import { Col as k } from "./index.es10.js"; const A = ({ titleTag: h = "h3", doctorName: a, specialties: d, contactInfo: o, schedule: s, avatar: i, button: e }) => { const m = () => o && (o == null ? void 0 : o.length) > 0, c = () => { var l; return s && ((l = s == null ? void 0 : s.days) == null ? void 0 : l.length) > 0; }, n = () => (e == null ? void 0 : e.label) && (e == null ? void 0 : e.onClick), w = () => m() || c(); return /* @__PURE__ */ r.jsxs("article", { className: "bg-white shadow br-x4 ui-card-doctor", children: [ /* @__PURE__ */ r.jsxs(p, { as: "header", gap: "x16", 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: "3" } ), /* @__PURE__ */ r.jsxs("div", { children: [ /* @__PURE__ */ r.jsx(h, { className: "fs-5 fw-semibold text-slate-20", children: a }), 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: [ m() && /* @__PURE__ */ r.jsx("dl", { className: "ui-card-doctor-contact-info", children: o == null ? void 0 : o.map((l) => /* @__PURE__ */ r.jsxs( "div", { role: "group", className: "ui-card-doctor-contact-detail", children: [ /* @__PURE__ */ r.jsx("dt", { className: "fs-6 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 )) }), w() && /* @__PURE__ */ r.jsx(t, { bg: "border-divider", className: "ui-card-doctor-divider" }), c() && /* @__PURE__ */ r.jsxs("div", { children: [ /* @__PURE__ */ r.jsx("h3", { className: "text-align-left fw-bold text-slate-28 mb-x8 fw-5", children: s == null ? void 0 : s.label }), /* @__PURE__ */ r.jsx("div", { role: "table", className: "ui-card-doctor-table", children: s == null ? void 0 : s.days.map((l, g) => { 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((x, N) => /* @__PURE__ */ r.jsxs("div", { children: [ /* @__PURE__ */ r.jsx("time", { dateTime: x.from, children: x.from }), /* @__PURE__ */ r.jsx("span", { "aria-hidden": "true", children: " - " }), /* @__PURE__ */ r.jsx("time", { dateTime: x.to, children: x.to }) ] }, `slot-${N}`)) ] }, `cell-${g}` ) ] }, l.label); }) }) ] }) ] }), n() && /* @__PURE__ */ r.jsx("footer", { children: /* @__PURE__ */ r.jsx(C, { className: "ui-card-doctor-btn", onClick: e == null ? void 0 : e.onClick, children: e == null ? void 0 : e.label }) }) ] }); }; export { A as CardDoctor }; //# sourceMappingURL=index.es55.js.map