import React,{useState} from 'react' import Api from '../../api/api'
const Select = ({data}) => { const [opt,setOpt]=useState('')
const handleChange=(e)=>{
setOpt(e.target.value)
}
return (
<>
<select onChange={(e) => handleChange(e)}>
{data.map(i=><>
<option selected={opt==i.id} value={i.id}>{i.name}</option>
</>)}
</select>
</>
)
} export default Select