import React, { memo, useCallback, ChangeEvent } from 'react' import { ChartPropertyWithControl, Flavor } from '../../../types' import { ControlContext, TextControlConfig } from '../types' import { Control, TextInput } from '../ui' interface TextControlProps { id: string property: ChartPropertyWithControl flavors: Flavor[] currentFlavor: Flavor value: string | number onChange: (value: string) => void context?: ControlContext } export const TextControl = memo( ({ id, property, flavors, currentFlavor, value, onChange, context }: TextControlProps) => { const handleUpdate = useCallback( (event: ChangeEvent) => onChange(event.target.value), [onChange] ) return ( ) } )