import * as React from "react";
import { ChevronsUpDown, Check } from "lucide-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 { cn } from "@/lib/utils";
type ComboboxProps = {
options: string[];
value: string;
onChange: (value: string) => void;
placeholder?: string;
label?: string;
};
export function OwnerCombobox({ options, value, onChange, placeholder = "Owner" }: ComboboxProps) {
const [open, setOpen] = React.useState(false);
return (
No owners found.
{
onChange("");
setOpen(false);
}}
>
All owners
{options.map((option) => (
{
onChange(option);
setOpen(false);
}}
>
{option}
))}
);
}
export function OrganizationCombobox({ options, value, onChange, placeholder = "Organization" }: ComboboxProps) {
const [open, setOpen] = React.useState(false);
return (
No organizations found.
{
onChange("");
setOpen(false);
}}
>
All organizations
{options.map((option) => (
{
onChange(option);
setOpen(false);
}}
>
{option}
))}
);
}