import { Paper, Text } from "@mantine/core"; import { useScopedI18n } from "@homarr/translation/client"; import { CommonChart } from "./common-chart"; export const SystemResourceCPUChart = ({ cpuUsageOverTime }: { cpuUsageOverTime: number[] }) => { const chartData = cpuUsageOverTime.map((usage, index) => ({ index, usage })); const t = useScopedI18n("widget.systemResources.card"); return ( 0 ? `${Math.round(cpuUsageOverTime[cpuUsageOverTime.length - 1]!)}%` : undefined } yAxisProps={{ domain: [0, 100] }} tooltipProps={{ content: ({ payload }) => { if (!payload) { return null; } const value = payload[0] ? Number(payload[0].value) : 0; return ( {value.toFixed(0)}% ); }, }} /> ); };