import { Listbox, Transition } from "@headlessui/react"; import React, { Fragment } from "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 function Dropdown(props: DropdownProps) { return (
{({ 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} ))} )}
); }