This commit is contained in:
zmeyer44 2023-10-23 14:54:55 -04:00
parent b6a0579de7
commit fb938204d4

View File

@ -72,49 +72,35 @@ function CommandSearch() {
</Button> </Button>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent className="z-modal+ w-auto p-0" align="start"> <PopoverContent className="z-modal+ w-auto p-0" align="start">
<Command className="rounded-lg border shadow-md"> <div className="rounded-lg border shadow-md">
<CommandInput disabled={!ready} placeholder="Search places..." />
<Input <Input
className="border-0 px-0 shadow-none focus-visible:ring-0" className="border-0 shadow-none focus-visible:ring-0"
value={value} value={value}
onChange={(e) => setValue(e.target.value)} onChange={(e) => setValue(e.target.value)}
placeholder="Search places..." placeholder="Search places..."
disabled={!ready} disabled={!ready}
/> />
<CommandList> <ul className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden")}>
<CommandEmpty>No results found.</CommandEmpty> {data.map(
<CommandGroup heading="Suggestions"> ({
{data.map( description,
({ place_id,
description, structured_formatting: { main_text, secondary_text },
place_id, }) => (
structured_formatting: { main_text, secondary_text }, <li
}) => ( key={place_id}
<CommandItem key={place_id}> className={cn(
<HiOutlineBuildingStorefront className="mr-2 h-4 w-4" /> "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
<span>{main_text}</span> )}
<span>{description}</span> >
</CommandItem> <HiOutlineBuildingStorefront className="mr-2 h-4 w-4" />
), <span>{main_text}</span>
)} <span>{description}</span>
</CommandGroup> </li>
<CommandSeparator /> ),
<CommandGroup heading="Vitrual"> )}
<CommandItem> </ul>
<HiOutlineBuildingStorefront className="mr-2 h-4 w-4" /> </div>
<span>Profile</span>
</CommandItem>
<CommandItem>
<HiOutlineBuildingStorefront className="mr-2 h-4 w-4" />
<span>Mail</span>
</CommandItem>
<CommandItem>
<HiOutlineBuildingStorefront className="mr-2 h-4 w-4" />
<span>Settings</span>
</CommandItem>
</CommandGroup>
</CommandList>
</Command>
</PopoverContent> </PopoverContent>
</Popover> </Popover>
); );