import React from "react";
import { InputProps } from "antd";
import { CustomInput, ErrorText, InputContainer, LabelText } from "./AntInputStyles";

export interface AntInputProps extends InputProps {
  errorText?: string;
  labelText?: string;
}
export const Input: React.FC<AntInputProps> = (props) => {
  const { status, errorText, labelText } = props;
  return (
    <InputContainer>
    <LabelText>{labelText}</LabelText>
      <CustomInput {...props} />
      {status == "error" ? <ErrorText>{errorText}</ErrorText> : null}
    </InputContainer>
  );
};
