UNPKG

@netdata/charts

Version:

Netdata frontend SDK and chart utilities

18 lines 610 B
import React from "react"; import { Flex, TextMicro } from "@netdata/netdata-ui"; import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime"; var ChangeIndicator = function ChangeIndicator(_ref) { var change = _ref.change; if (!change) return null; var color = change.direction === "up" ? "success" : "error"; var arrow = change.direction === "up" ? "↑" : "↓"; return /*#__PURE__*/_jsx(Flex, { alignItems: "center", gap: 1, children: /*#__PURE__*/_jsxs(TextMicro, { color: color, children: [change.formatted, " ", arrow] }) }); }; export default ChangeIndicator;