UNPKG

@devgateway/dvz-ui-react

Version:

A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.

34 lines (33 loc) 1.06 kB
import { jsxs as d, jsx as a } from "react/jsx-runtime"; import p from "react"; import { useDispatch as u, useSelector as i } from "react-redux"; import { Container as m, Icon as f } from "semantic-ui-react"; import I from "lodash.isequal"; const S = (l) => { const { "data-group": t, "data-reset-label": n = "Reset All Filters" } = l, c = u(), s = i((r) => r.getIn(["data", "posts", t])), e = i((r) => r.getIn(["data", "posts", "initialFilters", t])), o = p.useMemo(() => s && e ? !I(s, e) : !1, [s, e]); return /* @__PURE__ */ d( m, { fluid: !0, className: `data-filters-reset ignore ${o ? "" : "disabled"}`, onClick: () => { c({ type: "SET_INITIAL_POSTS_FILTER", group: t, ...e, reset: !0 }); }, children: [ /* @__PURE__ */ a("span", { children: n }), /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(f, { disabled: !o, name: "undo alternate", className: "custom-undo-icon" }) }) ] } ); }; export { S as default };