UNPKG

@anoki/fse-ui

Version:

FSE UI components library

79 lines (78 loc) 3.5 kB
import { j as s } from "./index.es244.js"; import './components/ui/CardNotification/CardNotification.css';/* empty css */ import { useMemo as v } from "react"; import { Actions as C } from "./index.es184.js"; import { Calendar as $ } from "./index.es176.js"; import { Row as i } from "./index.es9.js"; import { Button as e } from "./index.es28.js"; const T = ({ type: l, onClickEdit: r, onClickRightManage: t, rightManageTitle: d = "Gestisci", goToDetailsTitle: x = "Più dettagli", showExpired: m = !1, buttonMaxWidth: f, onClickGoToDetails: n, icon: a = "calendar", variant: h = "primary", onClickManage: c, date: j, title: p, showBadge: u = !1, text: b }) => { const o = h === "secondary", w = v(() => { if (a === "calendar") return /* @__PURE__ */ s.jsx($, { width: 24, height: 26, color: "slate-28" }); if (a === "actions") return /* @__PURE__ */ s.jsx(C, { width: 24, height: 26, color: "slate-28" }); }, [a]), N = ` ${o ? "bg-lightblue-a03 ui-card-notifications-secondary" : "bg-white"} shadow br-x4 `, g = ` ui-card-notifications-icon base-row ${o ? "bg-white" : "bg-lightblue-a03"} `, y = ` ${f ? "w-full" : "ui-card-notifications-button"} `; return /* @__PURE__ */ s.jsxs("div", { className: N, 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: j }) ] }), /* @__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: g, children: [ u && /* @__PURE__ */ s.jsx("div", { className: "ui-card-notifications-badge-container", children: /* @__PURE__ */ s.jsx("div", { className: "ui-card-notifications-badge" }) }), w ] }), /* @__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: p }), m && /* @__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: b }) ] }), c && /* @__PURE__ */ s.jsx("div", { className: "base-row justify-content-center", children: /* @__PURE__ */ s.jsx(e, { className: y, onClick: c, children: "Gestisci" }) }), /* @__PURE__ */ s.jsxs(i, { justifyContent: "flex-end", className: "w-full gap-x16", children: [ !!n && /* @__PURE__ */ s.jsx(e, { onClick: n, variant: "secondary", children: x }), t && /* @__PURE__ */ s.jsx("div", { className: "base-row justify-content-center", children: /* @__PURE__ */ s.jsx(e, { onClick: t, children: d }) }), !!r && /* @__PURE__ */ s.jsx( e, { onClick: r, bg: "transparent", textColor: "primary", children: "Modifica" } ) ] }) ] }) ] }) ] }); }; export { T as CardNotification }; //# sourceMappingURL=index.es76.js.map