index.js 610 Bytes
Newer Older
zhanghaozhe committed
1
import React from 'react';
zhanghaozhe committed
2 3 4
import './input.scss'
import classnames from "classnames";

zhanghaozhe committed
5 6 7 8
function Input({
                   icon,
                   wrapperClass,
                   children,
zhanghaozhe committed
9 10
                   value,
                   name,
zhanghaozhe committed
11 12 13 14 15 16
                   ...rest
               }) {
    return (
        <div className={classnames('input-wrapper', wrapperClass)}>
            <input
                className='input'
zhanghaozhe committed
17 18
                name={name}
                value={value}
zhanghaozhe committed
19 20 21 22 23 24
                {...rest}
            />
            {icon}
            {children}
        </div>
    )
zhanghaozhe committed
25 26
}

zhanghaozhe committed
27 28

export default Input;