From 834a53f34e5020f937ada7b35624df10d1d3fc72 Mon Sep 17 00:00:00 2001 From: BadriVishalPadhy <128573881+BadriVishalPadhy@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:28:37 +0530 Subject: [PATCH] fix/Auditlogs-Filters-now-can-be-press-on-filter --- .../app/(app)/audit/[bucket]/filter.tsx | 38 ++++++++----------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/apps/dashboard/app/(app)/audit/[bucket]/filter.tsx b/apps/dashboard/app/(app)/audit/[bucket]/filter.tsx index 9e2919fb15..e6812d740f 100644 --- a/apps/dashboard/app/(app)/audit/[bucket]/filter.tsx +++ b/apps/dashboard/app/(app)/audit/[bucket]/filter.tsx @@ -72,41 +72,35 @@ export const Filter: React.FC = ({ options, title, param }) => { const isSelected = selected.includes(option.value); return ( +
{ + + const next = isSelected + ? selected.filter((v) => v !== option.value) + : Array.from(new Set([...selected, option.value])); + setSelected(next); + }} + > { - const copySelected = new Set(selected); - if (isSelected) { - copySelected.delete(option.value); - } else { - copySelected.add(option.value); - } - // params.prefetch(param, Array.from(copySelected).join(",")); - }} key={option.value} onSelect={() => { const next = isSelected ? selected.filter((v) => v !== option.value) : Array.from(new Set([...selected, option.value])); - setSelected(next); - // params.set(param, next); }} > -
+
{option.label} +
); })}