diff --git a/frontend/src/components/BanTable.tsx b/frontend/src/components/BanTable.tsx index 6f4a5c1..938655d 100644 --- a/frontend/src/components/BanTable.tsx +++ b/frontend/src/components/BanTable.tsx @@ -9,7 +9,6 @@ */ import { memo, useMemo } from "react"; -import { useDashboardFilters } from "../providers/DashboardFilterProvider"; import { Badge, Button, @@ -42,16 +41,16 @@ interface BanTableProps { * Active time-range preset — controlled by the parent `DashboardPage`. * Changing this value triggers a re-fetch. */ - timeRange?: TimeRange; + timeRange: TimeRange; /** * Active origin filter — controlled by the parent `DashboardPage`. * Changing this value triggers a re-fetch and resets to page 1. */ - origin?: BanOriginFilter; + origin: BanOriginFilter; /** * Data source used for the table query. */ - source?: "fail2ban" | "archive"; + source: "fail2ban" | "archive"; } // --------------------------------------------------------------------------- @@ -194,14 +193,10 @@ function buildBanColumns(styles: ReturnType): TableColumnDefin */ export const BanTable = memo(function BanTable({ timeRange, origin, source }: BanTableProps): React.JSX.Element { const styles = useStyles(); - const context = useDashboardFilters(); - const effectiveTimeRange = timeRange ?? context.timeRange; - const effectiveOrigin = origin ?? context.originFilter; - const effectiveSource = source ?? context.source; const { banItems, total, page, setPage, loading, error, refresh } = useBans( - effectiveTimeRange, - effectiveOrigin, - effectiveSource, + timeRange, + origin, + source, ); const banColumns = useMemo(() => buildBanColumns(styles), [styles]);