From 1866d316dc38da9768e431f8b4a3700d971c0199 Mon Sep 17 00:00:00 2001 From: sandrvvu Date: Fri, 29 Nov 2024 13:46:48 +0200 Subject: [PATCH] fix: sonar issues --- src/design-system/components/chip/Chip.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/design-system/components/chip/Chip.tsx b/src/design-system/components/chip/Chip.tsx index 1ac1f0981..993c8f321 100644 --- a/src/design-system/components/chip/Chip.tsx +++ b/src/design-system/components/chip/Chip.tsx @@ -68,9 +68,9 @@ const ChipContent: React.FC = ({ endIcon }) => ( <> - {startIcon && {startIcon}} + {startIcon ? {startIcon} : null} {label} - {endIcon && {endIcon}} + {endIcon ? {endIcon} : null} ) @@ -89,7 +89,7 @@ const FilterChip: React.FC = ({ const handleSelect = (option: string) => { setSelectedOption(option) - setIsOpen((prev) => !prev) + setIsOpen(false) } const isSelected = Boolean(selectedOption) @@ -124,6 +124,7 @@ const FilterChip: React.FC = ({ onMouseDown={() => { handleSelect(option) }} + role='button' > {option}