UNPKG

@netdata/charts

Version:

Netdata frontend SDK and chart utilities

36 lines 1.07 kB
import React, { memo } from "react"; import { Menu } from "@netdata/netdata-ui"; import downloadSVG from "@netdata/netdata-ui/dist/components/icon/assets/download.svg"; import Icon, { Button } from "../icon"; import { useChart } from "../provider"; import { useDownloadItems } from "./download/useDownload"; import { jsx as _jsx } from "react/jsx-runtime"; var Download = function Download(_ref) { var disabled = _ref.disabled; var chart = useChart(); var items = useDownloadItems(chart); return /*#__PURE__*/_jsx(Menu, { items: items, dropProps: { align: { top: "bottom", right: "right" }, "data-toolbox": chart.getId() }, dropdownProps: { width: "130px" }, "data-track": chart.track("download-chart"), children: /*#__PURE__*/_jsx(Button, { icon: /*#__PURE__*/_jsx(Icon, { svg: downloadSVG, size: "14px" }), title: "Download", disabled: disabled, "data-testid": "chartHeaderToolbox-download" }) }); }; export default /*#__PURE__*/memo(Download);