"use client"; import * as React from "react"; import { Check, ChevronsUpDown } from "lucide-react"; import { cn } from "@/lib/utils"; 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"; const attributes = [ { value: "name", label: "name", }, { value: "phone", label: "phone", }, { value: "email", label: "email", }, { value: "id", label: "id", }, { value: "address", label: "address", }, ]; export function ContactSelector() { const [open, setOpen] = React.useState(false); const [value, setValue] = React.useState(""); return ( No attribute found. {attributes.map((attribute) => ( { setValue(currentValue === value ? "" : currentValue); setOpen(false); }} > {attribute.label} ))} ); }