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

export default function (props:TextAreaProps) {
    const { maxLength, value } = props;
    return (
        <div className={styles.container}>
            <Input.TextArea className={styles.input} {...props} />
            {maxLength ? (
                <span className={styles.wordNumber}>{`已输入${(value || '').length || 0}/${maxLength}`}</span>
            ) : null}
        </div>
    );
}
