'use client' import { Fragment, useEffect, useState } from 'react' import { Listbox, Transition } from '@headlessui/react' import { HiCheck, HiChevronDown } from 'react-icons/hi' export default function SelectBox(props) { //? Props const { list, placeholder, onChange, value } = props //? Render(s) return (
{value?.name ? ( {value.name} ) : ( {placeholder} )} {list?.map((item, idx) => ( `relative cursor-default select-none py-2 pl-10 pr-4 ${ active ? 'bg-amber-100 text-amber-900' : 'text-gray-900' }` } value={item} > {item.name} {value?._id === item._id ? ( ) : null} ))}
) }