import React from "react";
import { InputNumberProps } from "antd";
import { CustomInputNumber } from "./AntInputNumberStyles";
import { InputContainer, ErrorText } from "../AntInputStyles";
export interface AntInputNumberProps extends InputNumberProps {
  errorText?: string;
  labelText?: React.ReactNode;
}
export const InputNumber: React.FC<AntInputNumberProps> = (props) => {
  const { status, errorText, labelText } = props;
  return (
    <InputContainer>
      {labelText}
      <CustomInputNumber {...props} />
      {status == "error" ? <ErrorText>{errorText}</ErrorText> : null}
    </InputContainer>
  );
};
