fix combo box

This commit is contained in:
mbecker20
2024-03-31 13:23:05 -07:00
parent 12647896c4
commit c882c12890
4 changed files with 52 additions and 47 deletions

View File

@@ -35,6 +35,7 @@ import {
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@ui/command";
import { snake_case_to_upper_space_case } from "@lib/formatting";
@@ -194,21 +195,24 @@ export const ResourceSelector = ({
value={input}
onValueChange={setInput}
/>
<CommandEmpty className="flex justify-evenly items-center">
{`No ${type}s Found`}
<SearchX className="w-3 h-3" />
</CommandEmpty>
<CommandGroup>
{resources.map((resource) => (
<CommandItem
key={resource.id}
onSelect={() => onSelect && onSelect(resource.id)}
className="flex items-center justify-between"
>
<div className="p-1">{resource.name}</div>
</CommandItem>
))}
</CommandGroup>
<CommandList>
<CommandEmpty className="flex justify-evenly items-center">
{`No ${type}s Found`}
<SearchX className="w-3 h-3" />
</CommandEmpty>
<CommandGroup>
{resources.map((resource) => (
<CommandItem
key={resource.id}
onSelect={() => onSelect && onSelect(resource.id)}
className="flex items-center justify-between"
>
<div className="p-1">{resource.name}</div>
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>