import { BaseChart } from "@/Components/design-elements"; import Stack from "@mui/material/Stack"; import Typography from "@mui/material/Typography"; import { Gauge } from "lucide-react"; import { Cell, RadialBarChart, RadialBar, ResponsiveContainer } from "recharts"; import { useTranslation } from "react-i18next"; import { getResponseTimeColor } from "@/Utils/MonitorUtils"; import { useTheme } from "@mui/material/styles"; export const RadialAvgResponse = ({ avg, max }: { avg: number; max: number }) => { const { t } = useTranslation(); const theme = useTheme(); const chartData = [ { name: "max", value: max - avg, color: "transparent" }, { name: "avg", value: avg, color: "red" }, ]; const palette = getResponseTimeColor(avg); const msg: Record = { success: "Excellent", warning: "Average", danger: "Poor", }; return ( } title={t("common.charts.labels.averageResponseTime")} > {t("common.charts.labels.low")} {t("common.charts.labels.high")} {msg[palette]} {`${avg?.toFixed()}ms`} ); };