import { useBlocker } from '@use-blocker';

export const useBlockBack = (blockPaths: string[]) => {
  useBlocker(({ nextLocation }) => {
    if (blockPaths.includes(nextLocation.pathname)) {
      return true;
    }
    return false;
  });
};
