import React, { Fragment } from "react"; import { Listbox, Transition } from "@headlessui/react"; import { Icon, Icons } from "@/components/Icon"; export interface OptionItem { id: string; name: string; } interface DropdownProps { selectedItem: OptionItem; setSelectedItem: (value: OptionItem) => void; options: Array; } export const Dropdown = React.forwardRef( (props: DropdownProps) => (
{({ open }) => ( <> {props.selectedItem.name} {props.options.map((opt) => ( `relative cursor-default select-none py-2 pl-10 pr-4 ${ active ? "bg-denim-400 text-bink-700" : "text-white" }` } key={opt.id} value={opt} > {opt.name} ))} )}
) );