UNPKG

@anoki/fse-ui

Version:

FSE UI components library

107 lines (106 loc) 3.47 kB
import { j as e } from "./index.es180.js"; import './components/ui/DelegateCard/DelegateCard.css';/* empty css */ import { useRef as w } from "react"; import { Root as u, Indicator as g } from "./index.es219.js"; import { Row as t } from "./index.es9.js"; import { Col as r } from "./index.es10.js"; const y = ({ id: a, isSelected: i, title: d, subtitle: x, region: n, relation: l, isMe: s = !1, showRegion: o = !1, setSelectedCard: h = () => { }, className: p }) => { const f = w(null), m = (c) => c.charAt(0).toUpperCase() + c.slice(1), j = () => /* @__PURE__ */ e.jsx( "svg", { width: "14", height: "14", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx( "path", { d: "M10 3L4.5 8.5L2 6", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" } ) } ); return /* @__PURE__ */ e.jsxs( t, { br: "x4", p: "x24", gap: "x16", bg: "white", text: "slate-20", ref: f, className: `${p} ${i ? "ui-is-active" : ""} ui-card-delegate shadow cursor-pointer`, onClick: () => { h(a); }, style: { width: "100%" }, children: [ /* @__PURE__ */ e.jsx( u, { id: a, checked: i, className: "ui-checkbox-filter", children: /* @__PURE__ */ e.jsx(g, { children: /* @__PURE__ */ e.jsx(j, {}) }) } ), /* @__PURE__ */ e.jsxs( t, { alignItems: "flex-start", style: { width: "100%" }, justifyContent: "space-between", children: [ /* @__PURE__ */ e.jsxs(r, { style: { flex: 1 }, justifyContent: "center", className: "w-full", children: [ /* @__PURE__ */ e.jsxs( r, { gap: "x4", pb: (s || !s && !l) && !o ? void 0 : "x16", children: [ /* @__PURE__ */ e.jsx("h3", { className: "flex-1 text-decoration-none fs-4 fw-semibold", children: d }), /* @__PURE__ */ e.jsx("p", { className: "fs-6 fw-normal text-slate-28", children: x }) ] } ), /* @__PURE__ */ e.jsxs(t, { gap: "x40", justifyContent: "space-between", children: [ !s && l && /* @__PURE__ */ e.jsxs(r, { gap: "x4", children: [ /* @__PURE__ */ e.jsx("div", { className: "fw-bold", children: "Relazione con il delegante" }), /* @__PURE__ */ e.jsx("p", { className: "fw-normal", children: l }) ] }), o && n && /* @__PURE__ */ e.jsxs(r, { pr: "x104", gap: "x4", children: [ /* @__PURE__ */ e.jsx("div", { className: "fw-bold", children: "Regione di assistenza" }), /* @__PURE__ */ e.jsx("p", { className: "fw-normal", children: m(n) }) ] }) ] }) ] }), s && /* @__PURE__ */ e.jsx(t, { className: "ui-fascicolo-label", children: "IL TUO FASCICOLO" }) ] } ) ] } ); }; export { y as DelegateCard }; //# sourceMappingURL=index.es98.js.map