import React from "react"; import { Fragment } from "react"; import { useRouter } from "next/router"; import { faAngleDown,faCheck, faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Listbox, Transition } from "@headlessui/react"; /** * This is the component that we use for drop down lists. * @param {*} param0 * @returns */ export default function ListBox({ selected, onChange, data, text, buttonAction, width, workspaceMapping = [], }) { const router = useRouter(); return (
{text} {" "} {selected}
{data && (
)}
{data && ( {data.map((person, personIdx) => ( `my-0.5 relative cursor-default select-none py-2 pl-10 pr-4 rounded-md ${ selected ? "bg-white/10 text-gray-400 font-bold" : "" } ${ active & !selected ? "bg-white/5 text-mineshaft-200 cursor-pointer" : "text-gray-400" } ` } value={person} > {({ selected }) => ( <> {person} {selected ? ( ) : null} )} ))} {buttonAction && ( )} )}
); }