/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable react-hooks/exhaustive-deps */
import { useEffect } from 'react';
import { NativeMessage } from '@/shared/constants/native-message';
import { bridge } from '@/bridge';

export const useHardwareBackPressListener = (callback: () => void) => {
  useEffect(() => {
    // Subscribe to events from react native.
    return bridge.addEventListener(NativeMessage.HardwareBackPress, (message: any) => {
      callback?.();
    });
  }, []);
};
