UNPKG

@netdata/charts

Version:

Netdata frontend SDK and chart utilities

17 lines 585 B
import React, { useMemo } from "react"; import { TextMicro } from "@netdata/netdata-ui"; import { useChart } from "../../provider"; import { jsx as _jsx } from "react/jsx-runtime"; var Timestamp = function Timestamp(_ref) { var value = _ref.value; var chart = useChart(); var text = useMemo(function () { return "".concat(chart.formatDate(value), " \u2022 ").concat(chart.formatTime(value)); }, [value]); return /*#__PURE__*/_jsx(TextMicro, { color: "textDescription", "data-testid": "chartPopover-timestamp", children: text }); }; export default Timestamp;