mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 16:42:17 +03:00
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>
|
||
|
);
|