/**
 * Per-route document titles.
 *
 * A single static title makes browser history and a wall of open tabs useless
 * — every entry reads "pig" and nobody can tell the margin view from the
 * pipeline. The page name leads, because that is the part a tab strip has room
 * to show before truncating.
 */
import { useEffect } from 'react';

export function usePageTitle(title?: string): void {
  useEffect(() => {
    document.title = title ? `${title} · pig` : 'pig — Prime Intellect Growth';
    return () => {
      document.title = 'pig — Prime Intellect Growth';
    };
  }, [title]);
}
