import { useEffect } from 'react'; const APP_NAME = 'Liqa'; /** * Sets document.title to " | Liqa" for the current page. * Pass undefined or empty string to fall back to just "Liqa". */ export function usePageTitle(title: string | null | undefined): void { useEffect(() => { const prev = document.title; document.title = title ? `${title} | ${APP_NAME}` : APP_NAME; return () => { document.title = prev; }; }, [title]); }