UNPKG

@anoki/fse-marche-ui

Version:

FSE UI components library

97 lines (96 loc) 4 kB
import { j as l } from "./index.es137.js"; import { Avatar as N } from "./index.es56.js"; import './components/ui/CardDoctorInfo/CardDoctorInfo.css';/* empty css */ import { clsx as o } from "./index.es139.js"; import { Divider as p } from "./index.es153.js"; import n, { useState as w } from "react"; import { CategoryHeader as C } from "./index.es51.js"; import { Row as O } from "./index.es9.js"; import { Col as R } from "./index.es10.js"; const F = ({ titleTag: u = "h3", doctorName: a, specialties: t, contactInfo: m, avatar: s, className: c, officesInfo: e = [], officeLabel: g = "Ambulatorio" }) => { const [i, x] = w([]), j = () => m && (m == null ? void 0 : m.length) > 0, b = (r) => { i.includes(r) ? x(i.filter((d) => d !== r)) : x([...i, r]); }; return /* @__PURE__ */ l.jsxs( "article", { className: o("bg-white shadow br-x4 ui-card-doctor-info", c), children: [ /* @__PURE__ */ l.jsxs(O, { as: "header", gap: "x16", children: [ s && /* @__PURE__ */ l.jsx( N, { textColor: (s == null ? void 0 : s.textColor) ?? "slate-20", bg: (s == null ? void 0 : s.bg) ?? "lightblue-a01", initials: (s == null ? void 0 : s.initials) ?? "", className: "ui-card-doctor-avatar", size: "3" } ), /* @__PURE__ */ l.jsxs("div", { children: [ /* @__PURE__ */ l.jsx(u, { className: "fs-5 fw-semibold text-slate-20", children: a }), t && (t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ l.jsx("p", { className: "fs-6 text-slate-20 fw-regular", children: t == null ? void 0 : t.join(" | ") }) ] }) ] }), /* @__PURE__ */ l.jsxs("div", { className: "ui-card-doctor-content-info", children: [ j() && /* @__PURE__ */ l.jsx("dl", { className: "ui-card-doctor-contact-info", children: m == null ? void 0 : m.map((r) => /* @__PURE__ */ l.jsxs( "div", { role: "group", className: "ui-card-doctor-contact-detail-info", children: [ /* @__PURE__ */ l.jsx("dt", { className: "fs-6 fw-bold text-slate-28", children: r.label }), /* @__PURE__ */ l.jsx("dd", { className: "fs-6 fw-regular text-slate-28", children: r.value }) ] }, r.label )) }), (e == null ? void 0 : e.length) > 0 && /* @__PURE__ */ l.jsx( p, { bg: "border-divider", className: "ui-card-doctor-divider-info mt-x24" } ), /* @__PURE__ */ l.jsx(R, { children: (e == null ? void 0 : e.length) > 0 && (e == null ? void 0 : e.map((r, d) => /* @__PURE__ */ l.jsxs(n.Fragment, { children: [ /* @__PURE__ */ l.jsx( C, { title: `${g} ${d + 1}`, isOpen: i.includes(d), onToggle: () => b(d), hasBorder: !i.includes(d), className: "pt-x24" } ), i.includes(d) && /* @__PURE__ */ l.jsx("div", { className: o("ui-has-border-bottom", "pb-x24"), children: r.length > 0 && /* @__PURE__ */ l.jsx("dl", { className: "ui-card-doctor-contact-info", children: r == null ? void 0 : r.map((h) => /* @__PURE__ */ l.jsxs( "div", { role: "group", className: "ui-card-doctor-contact-detail-info", children: [ /* @__PURE__ */ l.jsx("dt", { className: "fs-6 fw-bold text-slate-28", children: h.label }), /* @__PURE__ */ l.jsx("dd", { className: "fs-6 fw-regular text-slate-28", children: h.value }) ] }, h.label )) }) }) ] }, d))) }) ] }) ] } ); }; export { F as CardDoctorInfo }; //# sourceMappingURL=index.es42.js.map