import { Alert, Input, Text } from "@hubspot/ui-extensions";

interface Props {
  handleCUIT: (value: string) => void;
  currentCUIT: string;
  showError: string | null;
}

export const ValidarARCA = ({ currentCUIT, handleCUIT, showError }: Props) => {
  return (
    <>
      <Text>Ingrese CUIT/CUIL para validar en ARCA</Text>
      <Input
        name="cuit"
        onChange={handleCUIT}
        value={currentCUIT}
        label="CUIL/CUIT"
        required
      />
      {showError && (
        <Alert title={showError} variant="warning">
          Por favor, corrija el CUIT ingresado
        </Alert>
      )}
    </>
  );
};
