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

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