import { useState, useCallback } from 'react';
import { generateQRCode } from 'react-native-cloud-ca';
const useGenerateQRCode = () => {
  const [result, setResult] = useState(null);
  const [error, setError] = useState(null);
  const [isLoading, setIsLoading] = useState(false);
  const generateQRCodeFunc = useCallback(async params => {
    try {
      setIsLoading(true);
      const response = await generateQRCode(params);
      setResult(response);
    } catch (e) {
      setError(e);
    } finally {
      setIsLoading(false);
    }
  }, []);
  return [result, error, generateQRCodeFunc, isLoading];
};
export default useGenerateQRCode;
//# sourceMappingURL=useGenerateQRCode.js.map