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 } = props;

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