import { Paper, Text } from "@mantine/core"; import { IconArrowDown, IconArrowUp } from "@tabler/icons-react"; import { humanFileSize } from "@homarr/common"; import { useScopedI18n } from "@homarr/translation/client"; import type { LabelDisplayModeOption } from ".."; import { CommonChart } from "./common-chart"; export const NetworkTrafficChart = ({ usageOverTime, isUp, hasShadow, labelDisplayMode, }: { usageOverTime: number[]; isUp: boolean; hasShadow: boolean; labelDisplayMode: LabelDisplayModeOption; }) => { const chartData = usageOverTime.map((usage, index) => ({ index, usage })); const t = useScopedI18n("widget.systemResources.card"); const max = Math.max(...usageOverTime); const upperBound = max + max * 0.2; return ( { const value = payload[0] ? Number(payload[0].value) : 0; return ( {humanFileSize(Math.round(value))}/s ); }, }} /> ); };