import { useEffect } from 'react';

export function useDocumentTitle(title: string, suffix: string = 'ThrillWiki') {
  useEffect(() => {
    const fullTitle = title ? `${title} | ${suffix}` : suffix;
    document.title = fullTitle;
    
    return () => {
      document.title = suffix;
    };
  }, [title, suffix]);
}
