feat: enhance UX with clickable items and simplified structure (#5387)

🔧 (dropdownComponent/index.tsx): refactor dropdownComponent to improve code readability and remove unnecessary ShadTooltip component
This commit is contained in:
Cristhian Zanforlin Lousa 2024-12-30 16:39:14 -03:00 • committed by GitHub
commit eb120c116e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,7 +131,6 @@ export default function Dropdown({
<CommandEmpty>No values found.</CommandEmpty> <CommandEmpty>No values found.</CommandEmpty>
<CommandGroup defaultChecked={false}> <CommandGroup defaultChecked={false}>
{filteredOptions?.map((option, index) => ( {filteredOptions?.map((option, index) => (
<ShadTooltip key={index} delayDuration={700} content={option}>
<div> <div>
<CommandItem <CommandItem
value={option} value={option}
@ -139,7 +138,7 @@ export default function Dropdown({
onSelect(currentValue); onSelect(currentValue);
setOpen(false); setOpen(false);
}} }}
className="items-center overflow-hidden truncate" className="items-center overflow-hidden truncate hover:cursor-pointer"
data-testid={`${option}-${index}-option`} data-testid={`${option}-${index}-option`}
> >
{customValue === option && ( {customValue === option && (
@ -155,7 +154,6 @@ export default function Dropdown({
/> />
</CommandItem> </CommandItem>
</div> </div>
</ShadTooltip>
))} ))}
</CommandGroup> </CommandGroup>
</CommandList> </CommandList>