import { useState, useCallback } from 'react';
import { registerDevice } from 'react-native-cloud-ca';
// import type {
// } from 'react-native-cloud-ca';

const useRegisterDevice = () => {
  const [result, setResult] = useState(null);
  const [error, setError] = useState(null);
  const [isLoading, setIsLoading] = useState(false);
  const registerDeviceFunc = useCallback(async params => {
    try {
      setIsLoading(true);
      const response = await registerDevice(params);
      setResult(response);
    } catch (e) {
      setError(e);
    } finally {
      setIsLoading(false);
    }
  }, []);
  return [result, error, registerDeviceFunc, isLoading];
};
export default useRegisterDevice;
//# sourceMappingURL=useRegisterDevice.js.map