import { useEffect } from 'react';
import { useConfig } from '../context/config-context';
function useWindowTitle(pageTitle, enabled = true) {
    const config = useConfig();
    useEffect(() => {
        if (!enabled) {
            return;
        }
        if (!pageTitle) {
            document.title = config.title;
            return;
        }
        document.title = `${config.title} - ${pageTitle}`;
    }, [config, config.title, pageTitle, enabled]);
}
export default useWindowTitle;
//# sourceMappingURL=use-window-title.js.map