import { useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.js";
import { useEffect } from "react";
//#region src/hooks/useDocumentTitle.tsx
const useDocumentTitle = (defaultPrefix, title) => {
	useIsomorphicLayoutEffect(() => {
		window.document.title = `${defaultPrefix} - ${title}`;
	}, [title, defaultPrefix]);
	useEffect(() => {
		return () => {
			window.document.title = defaultPrefix;
		};
	}, [defaultPrefix]);
};
//#endregion
export { useDocumentTitle };
