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, disabled, placeholder, autosize } = props;
    const selfProps = { value, disabled, placeholder, autosize };
    return (
        <div className={styles.container}>
            <Input.TextArea className={styles.input} {...selfProps} />
            {maxLength ? (
                <span className={styles.wordNumber}>{`已输入${(value || '').length || 0}/${maxLength}`}</span>
            ) : null}
        </div>
    );
}
