import {NativeModules} from 'react-native';

let AutoClick = {};

if (!NativeModules.AutoClick) {
  AutoClick = {
    isSettingsOn: async () => true,
  };
} else {
  AutoClick = {
    isSettingsOn: async () => {
      const enable = await NativeModules.AutoClick.isSettingsOn();
      AutoClick.enable = enable;
      return enable;
    },
    goSetting: NativeModules.AutoClick.goSetting,
  };
}

export default AutoClick;
