import React from 'react' import { Box, FormControl, FormLabel } from '@chakra-ui/react' import { CreatableSelect } from 'chakra-react-select' interface Props { label: string textField: string value: any bg: string handleInputChange: any options: any } const CreatableSelectInput = ({ label, textField, value, bg, handleInputChange, options}: Props) => { return ( {label} { if (values) { const valueArray = values.reduce((prev: string[], curr: any) => { prev.push(curr.value) return prev }, []) handleInputChange(textField, valueArray) } }} value={value} options={options} /> ) } export default CreatableSelectInput