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