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.

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