Add React.memo to heavy dashboard components

This commit is contained in:
2026-04-20 20:00:59 +02:00
parent 1d6564aa32
commit 1694ac17f8
7 changed files with 58 additions and 18 deletions

View File

@@ -4,7 +4,7 @@
* Calls `useBanTrend` internally and handles loading, error, and empty states.
*/
import { useMemo } from "react";
import { memo, useMemo } from "react";
import {
Area,
AreaChart,
@@ -194,7 +194,7 @@ function TrendTooltip(props: TrendTooltipProps): React.JSX.Element | null {
*
* @param props - `timeRange` and `origin` filter props.
*/
export function BanTrendChart({
export const BanTrendChart = memo(function BanTrendChart({
timeRange,
origin,
source = "fail2ban",
@@ -271,5 +271,5 @@ export function BanTrendChart({
</div>
</ChartStateWrapper>
);
}
});