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

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