@netdata/charts
Version:
Netdata frontend SDK and chart utilities
19 lines • 735 B
JavaScript
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 === "neutral" ? "stale" : change.direction === "up" ? "secondaryColorAI" : "warningText";
var arrow = change.direction === "neutral" ? "=" : change.direction === "up" ? "↑" : "↓";
return /*#__PURE__*/_jsx(Flex, {
alignItems: "center",
gap: 1,
children: /*#__PURE__*/_jsxs(TextMicro, {
color: color,
whiteSpace: "nowrap",
children: [change.formatted, " ", arrow]
})
});
};
export default ChangeIndicator;