// ============================================================
// TextInput — textEdit → Input.TextArea
// 用于提示词、文本合成等长文本输入场景
// ============================================================

import { Input } from 'antd';
import type { WidgetProps } from './types';

const { TextArea } = Input;

export function TextInput({ value, onChange, disabled, config }: WidgetProps) {
   return (
      <TextArea
         rows={4}
         value={value as string}
         onChange={(e) => onChange?.(e.target.value)}
         disabled={disabled}
         placeholder={(config.placeholder as string) || '请输入'}
         maxLength={config.maxLength as number | undefined}
         showCount={config.maxLength !== undefined}
      />
   );
}
