import React from 'react';

export interface ICustomInputProps {
   inputProps?: any;
   title?: any; // titulo do campo
   prefix?: string | JSX.Element; // prefix to component input
   suffix?: string | JSX.Element; // suffix to component input
   error?: string; // string de erro
   focus?: boolean;
   loading?: boolean;
   password?: boolean;
   textCenter?: boolean;
   hidePassword?: boolean;
   setHidePassword?: (v: boolean) => void;
}

export interface IInputProps extends React.ComponentProps<any> {
   name?: any; // name do input (Se name for definido Unnform será ativado)
   title?: any; // titulo do campo
   prefix?: string | JSX.Element; // prefix to component input
   suffix?: string | JSX.Element; // suffix to component input
   textRight?: boolean; // alinha texto de input right
   textCenter?: boolean; // alinha texto de input center
   password?: boolean; // mostrar/esconder senha
   loading?: boolean; // ativa icone de loading
   type?: string; // tipo do input
   mask?: 'CEP' | 'CNPJ' | 'CPF' | 'RG' | 'phone' | 'number' | 'no-spaces'; // máscara do input
   withoutDotNumber?: boolean; // quando mask for 'number', não mostra pontos nas casas de 1000
   decimals?: number; // quando mask for 'number', quantidade de decimais
   error?: string; // string de erro
   value?: string; // value do input caso use com input state
   onInput?: (text: string) => void; // callback ao digitar no input
   onEnter?: (text: string) => void; // callback ao pressionar enter
   defaultValue?: string; // valor padrão
   CustomComponent?: React.FunctionComponent<ICustomInputProps>; // Custom component
   as?: React.FunctionComponent<any>;
}
