import { useEffect } from 'react';

const BASE_TITLE = 'Сбербанк';

export const usePageTitle = (title?: string) => {
  useEffect(() => {
    if (typeof document === 'undefined') {
      return;
    }
    document.title = title ? `${title} | ${BASE_TITLE}` : BASE_TITLE;
  }, [title]);
};
