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:
parent
870aedf74e
commit
eb120c116e
1 changed files with 22 additions and 24 deletions
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue