diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-21 13:54:41 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-11-21 13:54:41 +0700 |
| commit | d3848251a01b2e35b3765e3660171cc085d76e18 (patch) | |
| tree | b38ca055aa30ba2ed88c19b051fe00fd5a96a706 /src-migrate/common/components | |
| parent | f76c895fa0ab29d4f57f234b58227a43cd9d5e20 (diff) | |
Add Seo component and use on register
Diffstat (limited to 'src-migrate/common/components')
| -rw-r--r-- | src-migrate/common/components/elements/Seo.tsx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src-migrate/common/components/elements/Seo.tsx b/src-migrate/common/components/elements/Seo.tsx new file mode 100644 index 00000000..2245663a --- /dev/null +++ b/src-migrate/common/components/elements/Seo.tsx @@ -0,0 +1,34 @@ +import { useRouter } from 'next/router' +import React from 'react' +import { NextSeo } from "next-seo" +import { MetaTag, NextSeoProps } from 'next-seo/lib/types'; + +const Seo = (props: NextSeoProps) => { + const router = useRouter() + + const additionalMetaTags: MetaTag[] = [ + { + property: 'fb:app_id', + content: '270830718811' + }, + { + property: 'fb:page_id', + content: '101759953569' + }, + ] + + if (!!props.additionalMetaTags) additionalMetaTags.push(...props.additionalMetaTags) + + return ( + <NextSeo + defaultTitle='Indoteknik.com: B2B Industrial Supply & Solution' + canonical={process.env.NEXT_PUBLIC_SELF_HOST + router.asPath} + description={props.title} + {...props} + openGraph={{ siteName: 'Indoteknik.com', ...props.openGraph }} + additionalMetaTags={additionalMetaTags} + /> + ) +} + +export default Seo
\ No newline at end of file |
