import Head from 'next/head'; import { uiUrl } from '@/config/site'; import { useRouter } from 'next/router'; export default function Title({ meta = { title: '', image: '', description: '', }}) { const router = useRouter(), path = router.pathname; let section = ''; if (path.match(/\/docs/)) { section = 'Documentation'; } const title = meta.title ? `${meta.title} - ${section ? `${section} - ` : ''}Tabler` : 'Tabler: Premium dashboard template with responsive and high quality UI'; const image = `${meta.image ? meta.image : `${uiUrl}/img/tabler/og.png?2`}`; const description = meta.description ? meta.description : 'Tabler comes with tons of well-designed components and features. Start your adventure with Tabler and make your dashboard great again. For free!'; const canonical = `${uiUrl}${(path === '/' ? '' : path).split('?')[0]}`; return ( {title} ); }