From 0b14f3bd9f02633b4fef354cd11c383cecbeaad1 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 13 Apr 2024 08:10:09 -0600 Subject: [PATCH] Reuse label filter content --- web/src/pages/SubmitPlus.tsx | 76 +++++++++--------------------------- 1 file changed, 19 insertions(+), 57 deletions(-) diff --git a/web/src/pages/SubmitPlus.tsx b/web/src/pages/SubmitPlus.tsx index f520914ea..d1214fdf6 100644 --- a/web/src/pages/SubmitPlus.tsx +++ b/web/src/pages/SubmitPlus.tsx @@ -1,6 +1,9 @@ import { baseUrl } from "@/api/baseUrl"; import FilterCheckBox from "@/components/filter/FilterCheckBox"; -import { CamerasFilterButton } from "@/components/filter/ReviewFilterGroup"; +import { + CamerasFilterButton, + GeneralFilterContent, +} from "@/components/filter/ReviewFilterGroup"; import { Button } from "@/components/ui/button"; import { Dialog, @@ -252,8 +255,14 @@ function PlusFilterGroup({ }} > - - - Filter Labels - - - { - if (isChecked) { - setCurrentLabels(undefined); - } - }} + setOpen("none")} /> - -
- {allLabels.map((item) => ( - { - if (isChecked) { - const updatedLabels = currentLabels - ? [...currentLabels] - : []; - - updatedLabels.push(item); - setCurrentLabels(updatedLabels); - } else { - const updatedLabels = currentLabels - ? [...currentLabels] - : []; - - // can not deselect the last item - if (updatedLabels.length > 1) { - updatedLabels.splice(updatedLabels.indexOf(item), 1); - setCurrentLabels(updatedLabels); - } - } - }} - /> - ))} -
- -
- -