UNPKG

@anoki/fse-marche-ui

Version:

FSE UI components library

77 lines (76 loc) 3.44 kB
import { j as s } from "./index.es137.js"; import './components/ui/CardNotification/CardNotification.css';/* empty css */ import { useMemo as g } from "react"; import { Actions as y } from "./index.es100.js"; import { Calendar as v } from "./index.es93.js"; import { Row as i } from "./index.es9.js"; import { Button as e } from "./index.es25.js"; const O = ({ type: l, onClickEdit: r, onClickRightManage: t, showExpired: d = !1, buttonMaxWidth: x, onClickGoToDetails: n, icon: a = "calendar", variant: m = "primary", onClickManage: c, date: f, title: h, showBadge: j = !1, text: p }) => { const o = m === "secondary", u = g(() => { if (a === "calendar") return /* @__PURE__ */ s.jsx(v, { width: 24, height: 26, color: "slate-28" }); if (a === "actions") return /* @__PURE__ */ s.jsx(y, { width: 24, height: 26, color: "slate-28" }); }, [a]), b = ` ${o ? "bg-lightblue-a03 ui-card-notifications-secondary" : "bg-white"} shadow br-x4 `, w = ` ui-card-notifications-icon base-row ${o ? "bg-white" : "bg-lightblue-a03"} `, N = ` ${x ? "w-full" : "ui-card-notifications-button"} `; return /* @__PURE__ */ s.jsxs("div", { className: b, children: [ /* @__PURE__ */ s.jsxs(i, { px: "x24", py: "x8", justifyContent: "space-between", children: [ /* @__PURE__ */ s.jsxs("p", { className: "fs-7 fw-semibold", children: [ " ", l ] }), /* @__PURE__ */ s.jsx("p", { className: "fs-7 fw-semibold", children: f }) ] }), /* @__PURE__ */ s.jsx("div", { className: "ui-card-notifications-divider " }), /* @__PURE__ */ s.jsxs(i, { pt: "x16", px: "x24", pb: "x24", gap: "x16", children: [ /* @__PURE__ */ s.jsxs("div", { className: w, children: [ j && /* @__PURE__ */ s.jsx("div", { className: "ui-card-notifications-badge-container", children: /* @__PURE__ */ s.jsx("div", { className: "ui-card-notifications-badge" }) }), u ] }), /* @__PURE__ */ s.jsxs("div", { className: "w-full", children: [ /* @__PURE__ */ s.jsxs("div", { className: "mb-x24", children: [ /* @__PURE__ */ s.jsx("p", { className: "my-x8 fs-5 fw-semibold", children: h }), d && /* @__PURE__ */ s.jsx(i, { mb: "x8", children: /* @__PURE__ */ s.jsx( "div", { className: "py-x4 px-x16 bg-status-error text-white rounded fw-semibold fs-7", children: "SCADUTO" } ) }), /* @__PURE__ */ s.jsx("p", { children: p }) ] }), c && /* @__PURE__ */ s.jsx("div", { className: "base-row justify-content-center", children: /* @__PURE__ */ s.jsx(e, { className: N, onClick: c, children: "Gestisci" }) }), /* @__PURE__ */ s.jsxs(i, { justifyContent: "flex-end", className: "w-full gap-x16", children: [ t && /* @__PURE__ */ s.jsx("div", { className: "base-row justify-content-center", children: /* @__PURE__ */ s.jsx(e, { onClick: t, children: "Gestisci" }) }), !!r && /* @__PURE__ */ s.jsx( e, { onClick: r, bg: "transparent", textColor: "primary", children: "Modifica" } ), !!n && /* @__PURE__ */ s.jsx(e, { onClick: n, variant: "secondary", children: "Più dettagli" }) ] }) ] }) ] }) ] }); }; export { O as CardNotification }; //# sourceMappingURL=index.es67.js.map