import * as React from "react"; import { Button } from "@/components/ui/button"; import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from "@/components/ui/command"; import { Popover, PopoverContent, PopoverTrigger, } from "@/components/ui/popover"; import { ChevronDownIcon } from "@heroicons/react/24/solid"; import { getAvailableSites } from "@/utils"; import { SelectOptions, SiteList } from "@/types.js"; import slugify from "slugify"; export function SitesCombobox({ siteList }: { siteList: SiteList }) { const sites = Object.entries(siteList).map((item) => { return { label: item[1].name, value: slugify(item[0]), }; }); const [open, setOpen] = React.useState(false); const [selectedSite, setSelectedSite] = React.useState( null ); return (
No results found. {sites?.map((status) => ( { setSelectedSite( sites.find((priority) => priority.value === value) || null ); setOpen(false); }} > {status.label} ))}
); }