import useSWR from "swr";
import { useTranslation } from "next-i18next";
import classNames from "classnames";
import Error from "../error";
import Node from "./node";
export default function Widget({ options }) {
const { cluster, nodes } = options;
const { i18n } = useTranslation();
const defaultData = {
cpu: {
load: 0,
total: 0,
percent: 0
},
memory: {
used: 0,
total: 0,
free: 0,
precent: 0
}
};
const { data, error } = useSWR(
`/api/widgets/kubernetes?${new URLSearchParams({ lang: i18n.language }).toString()}`, {
refreshInterval: 1500
}
);
if (error || data?.error) {
return