export function createEscAbortControllerHelper(): AbortController {
  const escAbortController = new AbortController();
  const escKeyHandler = (event: KeyboardEvent) => {
    if (event.key === 'Escape') {
      escAbortController.abort();
      document.removeEventListener('keydown', escKeyHandler);
    }
  };

  document.addEventListener('keydown', escKeyHandler);

  return escAbortController;
}
