@anoki/fse-ui
Version:
FSE UI components library
100 lines (99 loc) • 3.49 kB
JavaScript
import { j as s } from "./index.es237.js";
import './components/ui/CardMapDoctor/CardMapDoctor.css';/* empty css */
import { useState as o, useRef as b } from "react";
import { Checkbox as C, CheckboxIndicator as N } from "./index.es338.js";
import { useClickOutside as d } from "./index.es339.js";
import { CheckIcon as k } from "./index.es174.js";
import { Row as x } from "./index.es116.js";
import { Col as f } from "./index.es61.js";
import { ArrowLink as g } from "./index.es25.js";
const B = ({
titleTag: h = "h1",
availableLabel: p = "Disponibile",
specialization: l,
addressLabel: u,
className: j,
doctor: e,
setSelectedCard: r = () => {
},
keepSelectionOnNavigation: w = !1,
ctaTitle: t,
ctaAction: n
}) => {
const [a, c] = o(!1), m = b(null), i = e == null ? void 0 : e.offices[0];
return d(
m,
a,
() => c(!1),
() => r(""),
w
), /* @__PURE__ */ s.jsxs(
x,
{
br: "x4",
p: "x24",
gap: "x16",
bg: "white",
text: "slate-20",
ref: m,
className: `${j} ${a ? "ui-is-active ui-card-search" : "ui-card-search"} shadow cursor-pointer`,
onClick: () => {
c(!0), r(e == null ? void 0 : e.code);
},
children: [
/* @__PURE__ */ s.jsx(
C,
{
id: e == null ? void 0 : e.code,
checked: a,
className: "ui-checkbox-filter",
children: /* @__PURE__ */ s.jsx(N, { children: /* @__PURE__ */ s.jsx(k, { width: 14, height: 14, color: "white" }) })
}
),
/* @__PURE__ */ s.jsxs(f, { justifyContent: "center", className: "w-full", children: [
/* @__PURE__ */ s.jsxs(f, { pb: "x16", children: [
/* @__PURE__ */ s.jsxs(h, { className: "flex-1 text-decoration-none fs-4 fw-semibold", children: [
"Dott. ",
e == null ? void 0 : e.firstName,
" ",
e == null ? void 0 : e.lastName
] }),
!!l && /* @__PURE__ */ s.jsx("p", { className: "fs-6 fw-regular text-slate-28", children: l }),
/* @__PURE__ */ s.jsx(
"div",
{
className: "ui-available-label mt-x4 px-x16 py-x4 bg-status-success text-white rounded fw-semibold fs-7",
children: p.toUpperCase()
}
)
] }),
/* @__PURE__ */ s.jsxs(x, { justifyContent: "space-between", alignItems: "end", children: [
/* @__PURE__ */ s.jsxs("div", { className: "text-slate-28 fs-6", children: [
/* @__PURE__ */ s.jsx("div", { className: "fw-bold", children: u }),
/* @__PURE__ */ s.jsx("div", { className: "w-full", children: /* @__PURE__ */ s.jsxs("p", { className: "fw-regular", children: [
i != null && i.address ? i.address.charAt(0).toUpperCase() + i.address.slice(1).toLowerCase() : "",
",",
" ",
i != null && i.city ? i.city.charAt(0).toUpperCase() + i.city.slice(1).toLowerCase() : ""
] }) })
] }),
t && n && /* @__PURE__ */ s.jsx(
g,
{
asButton: !0,
onClick: n,
arrowVisible: !1,
className: "cursor-pointer",
children: t
}
)
] })
] })
]
}
);
};
export {
B as CardMapDoctor
};
//# sourceMappingURL=index.es46.js.map