import useSWR from "swr"; import { BiError } from "react-icons/bi"; import { useTranslation } from "next-i18next"; import Node from "./node"; export default function Widget({ options }) { const { cluster, nodes } = options; const { t, 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 (