import React from 'react' import {Control, Field, Input as I, Heading} from 'bloomer' import {IconType} from 'react-icons' export interface IInputProps { name: string type: 'text' | 'password' | 'hidden' | 'submit' | 'email' value?: string onChange?: (name: this['name'], value: string) => void placeholder?: string readOnly?: boolean label: string Icon?: IconType required?: boolean } export class Input extends React.PureComponent { handleChange = (e: React.ChangeEvent) => { if (this.props.onChange) { this.props.onChange(this.props.name, e.target.value) } } render() { const {Icon} = this.props return ( {this.props.label} {Icon && } ) } }