import React, { ChangeEvent, useEffect } from 'react' interface DropdownProps { label: string options: string[] state: string setState: (state: string) => void } const Dropdown = ({ options, label, state, setState }: DropdownProps) => { const handleChange = (event: ChangeEvent) => { setState(event.target.value) } useEffect(() => { if (options.length > 0) { setState(options[0]) } }, [options, setState]) return (
) } export default Dropdown