import { useEffect } from 'react'

export const DEFAULT_PAGE_TITLE = 'کاتالوگ دیجیتال | داناک'
const BRAND_SUFFIX = ' | داناک'

export function formatPageTitle(pageTitle: string): string {
  return `${pageTitle}${BRAND_SUFFIX}`
}

export function usePageTitle(pageTitle: string) {
  useEffect(() => {
    document.title = formatPageTitle(pageTitle)
  }, [pageTitle])
}
