import { type FC } from 'react'
import { useLocation } from 'react-router-dom'
import TitleLine from './TitleLine'
import { getPageTitle } from '../config/PageTitles'

type Props = {
    title1?: string
}

const PageTitle: FC<Props> = ({ title1 }) => {
    const location = useLocation()
    const title = getPageTitle(location.pathname)

    return <TitleLine title={title1 || title} />
}

export default PageTitle
