/* eslint-disable no-use-before-define */ import React, { HTMLAttributes, FC } from 'react'; import Box from '@material-ui/core/Box'; import TextField from '@material-ui/core/TextField'; import { Autocomplete } from '@material-ui/lab'; import { makeStyles } from '@material-ui/core/styles'; import { LinkedDataIdentifier } from '../LinkedDataIdentifier'; import { Typography } from '@material-ui/core'; const useStyles = makeStyles({ option: { fontSize: 15, '& > span': { marginRight: 10, fontSize: 18, }, }, }); export interface Props extends HTMLAttributes { label: any; value: any; options: any; onChange: any; } export const SelectByImage: FC = ({ label, value, options, onChange, }) => { const classes = useStyles(); const [state, setState] = React.useState({ selectedOption: value, }); return ( option.label} renderOption={(option: any) => ( {option.label} {option.label} )} onChange={(_event: any, vendor: any) => { if (vendor) { setState({ ...state, selectedOption: vendor, }); onChange(vendor.value); } }} value={state.selectedOption} renderInput={(params: any) => ( )} /> ); };