import React from 'react';
import { Input } from 'antd';
import styles from './styles.less';
import { InputProps } from '../editInterface';

export default function(props: InputProps) {
    const { value, maxLength, placeholder,onChange } = props;
    const selfProps = { value, maxLength, placeholder,onChange };

    return (
        <div className={styles.container}>
            <Input className={styles.input} {...selfProps} />
            {maxLength && (
                <span className={styles.wordNumber}>
                    已输入{(value || '').length || 0}/{maxLength}
                </span>
            )}
        </div>
    );
}
