UNPKG

@anoki/fse-ui

Version:

FSE UI components library

74 lines (73 loc) 2.44 kB
import { j as e } from "./index.es237.js"; import './sections/TableCard/TableCard.css';/* empty css */ import { useState as p, useMemo as x } from "react"; import { useDebouncedValue as d } from "./index.es254.js"; import { Search as u } from "./index.es117.js"; import { GridContainer as f } from "./index.es95.js"; import { GridItem as j } from "./index.es96.js"; import { Section as h, SectionHeading as b } from "./index.es123.js"; import { Col as w } from "./index.es61.js"; import { Row as m } from "./index.es116.js"; import { CardFile as C } from "./index.es44.js"; const R = ({ title: n, headerTitle: l, data: s = [] }) => { const [a, c] = p(""), o = d(a.trim().toLowerCase(), 300), i = x(() => o ? s.filter( (t) => [t.title, t.description].some( (r) => r == null ? void 0 : r.toLowerCase().includes(o) ) ) : s, [o, s]); return /* @__PURE__ */ e.jsxs(h, { className: "table-card", children: [ /* @__PURE__ */ e.jsx( b, { title: n, mdFs: "2", fs: "3", color: "primary", className: "table-card-section-title" } ), /* @__PURE__ */ e.jsxs(w, { children: [ /* @__PURE__ */ e.jsx( m, { alignItems: "flex-start", className: "header-row", justifyContent: "space-between", flexWrap: "wrap", children: /* @__PURE__ */ e.jsx("p", { className: "update-title", children: l }) } ), /* @__PURE__ */ e.jsxs( m, { alignItems: "flex-start", className: "header-row border-bottom", justifyContent: "space-between", flexWrap: "wrap", children: [ /* @__PURE__ */ e.jsxs("span", { className: "info", children: [ "(Numero elementi: ", i.length, ")" ] }), /* @__PURE__ */ e.jsx( u, { variant: "outlined", btnText: "", helperText: "", value: a, onChangeValue: c } ) ] } ), /* @__PURE__ */ e.jsx(f, { gap: "x24", mt: "x32", px: "x12", children: i.map((t, r) => /* @__PURE__ */ e.jsx(j, { sm: 6, md: 4, children: /* @__PURE__ */ e.jsx(C, { ...t }) }, `table-card-${r}`)) }) ] }) ] }); }; export { R as TableCard }; //# sourceMappingURL=index.es152.js.map