@netdata/charts
Version:
Netdata frontend SDK and chart utilities
30 lines • 929 B
JavaScript
import React from "react";
import styled from "styled-components";
import { Button } from "@netdata/netdata-ui";
import { useChart, useAttributeValue } from "../provider/selectors";
import { jsx as _jsx } from "react/jsx-runtime";
var StyledButton = styled(Button).attrs({
flavour: "borderless",
label: "Reset",
width: "initial",
height: "initial",
padding: [0, 1],
title: "Reset Filters",
small: true,
neutral: true
}).withConfig({
displayName: "reset__StyledButton",
componentId: "sc-kilpc3-0"
})(["&&{height:initial;font-weight:normal;}"]);
var Reset = function Reset() {
var chart = useChart();
var pristineValues = useAttributeValue("pristine");
var isPristine = !Object.keys(pristineValues).length;
return /*#__PURE__*/_jsx(StyledButton, {
"data-noprint": true,
disabled: isPristine,
onClick: chart.resetPristine,
"data-track": chart.track("reset")
});
};
export default Reset;