import React from "react";
import { ErrorText, InputContainer } from "../AntInputStyles";
import { CustomTextArea } from "./AntOpenTextStyles";
import { TextAreaProps } from "antd/es/input";

export interface AntTextAreaProps extends TextAreaProps {
  errorText?: string;
  labelText?: React.ReactNode;
  width?: string;
}
export const OpenText: React.FC<AntTextAreaProps> = (props) => {
  const { status, errorText, labelText } = props;
  return (
    <InputContainer>
    {labelText}
      <CustomTextArea {...props} />
      {status == "error" ? <ErrorText>{errorText}</ErrorText> : null}
    </InputContainer>
  );
};