import { Fragment, useState } from 'react' import { Menu, Transition } from '@headlessui/react' import { ChevronDownIcon } from '@heroicons/react/24/outline' function classNames(...classes: any) { return classes.filter(Boolean).join(' ') } type Props = { title: string data: string[] } export const DropdownsList: React.FC = ({ data, title }) => { const [checked, setChecked] = useState(data[0]) return (

{title}

{checked}
{data.map((item, index) => ( {({ active }) => ( setChecked(item)} href="#" className={classNames( active ? 'bg-gray-100 text-gray-900' : 'text-gray-700', 'block px-4 py-2 text-sm' )} > {item} )} ))}
) }