From 9fcc31319d377e21488e88df6db6d860d5b51dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl-Gerhard=20Lindesva=CC=88rd?= Date: Sun, 11 Aug 2024 23:33:47 +0200 Subject: [PATCH] fix combobox-advanced --- apps/dashboard/src/components/ui/checkbox.tsx | 15 +++++++++++++++ .../src/components/ui/combobox-advanced.tsx | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/dashboard/src/components/ui/checkbox.tsx b/apps/dashboard/src/components/ui/checkbox.tsx index 098485e9..00c7413c 100644 --- a/apps/dashboard/src/components/ui/checkbox.tsx +++ b/apps/dashboard/src/components/ui/checkbox.tsx @@ -5,6 +5,21 @@ import { cn } from '@/utils/cn'; import * as CheckboxPrimitive from '@radix-ui/react-checkbox'; import { Check } from 'lucide-react'; +export const DumpCheckbox = ({ checked }: { checked: boolean }) => { + return ( +
+
+ {checked && } +
+
+ ); +}; + const Checkbox = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef diff --git a/apps/dashboard/src/components/ui/combobox-advanced.tsx b/apps/dashboard/src/components/ui/combobox-advanced.tsx index 8c856424..bbff676c 100644 --- a/apps/dashboard/src/components/ui/combobox-advanced.tsx +++ b/apps/dashboard/src/components/ui/combobox-advanced.tsx @@ -7,7 +7,7 @@ import VirtualList from 'rc-virtual-list'; import { useOnClickOutside } from 'usehooks-ts'; import { Button } from './button'; -import { Checkbox } from './checkbox'; +import { Checkbox, DumpCheckbox } from './checkbox'; import { Popover, PopoverContent, PopoverTrigger } from './popover'; type IValue = any; @@ -61,7 +61,7 @@ export function ComboboxAdvanced({ }} className={'flex cursor-pointer items-center gap-2'} > - + {item?.label ?? item?.value} ); @@ -99,7 +99,7 @@ export function ComboboxAdvanced({