3b7d35ed0a
no issue
23 lines
746 B
JavaScript
23 lines
746 B
JavaScript
export default ({type, name, placeholder, value = '', error, onInput, required, className, children, icon}) => (
|
|
<div className="gm-form-element">
|
|
<div className="gm-input">
|
|
<input
|
|
type={ type }
|
|
name={ name }
|
|
key={ name }
|
|
placeholder={ placeholder }
|
|
value={ value }
|
|
onInput={ (e) => onInput(e, name) }
|
|
required={ required }
|
|
className={[
|
|
(value ? "gm-input-filled" : ""),
|
|
(error ? "gm-error" : ""),
|
|
className
|
|
].join(' ')}
|
|
/>
|
|
<i>{ icon }</i>
|
|
{ children }
|
|
</div>
|
|
</div>
|
|
);
|