2023-12-06 07:30:47 +01:00
|
|
|
import { env } from '@typebot.io/env'
|
2021-11-29 15:19:07 +01:00
|
|
|
import Head from 'next/head'
|
|
|
|
|
2023-12-06 07:30:47 +01:00
|
|
|
const getOrigin = () => {
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
return window.location.origin
|
|
|
|
}
|
|
|
|
|
|
|
|
return env.NEXTAUTH_URL
|
|
|
|
}
|
|
|
|
|
2021-11-29 15:19:07 +01:00
|
|
|
export const Seo = ({
|
|
|
|
title,
|
|
|
|
description = 'Create and publish conversational forms that collect 4 times more answers and feel native to your product',
|
2023-12-06 07:30:47 +01:00
|
|
|
imagePreviewUrl = `${getOrigin()}/images/og.png`,
|
2021-11-29 15:19:07 +01:00
|
|
|
}: {
|
|
|
|
title: string
|
|
|
|
description?: string
|
|
|
|
currentUrl?: string
|
|
|
|
imagePreviewUrl?: string
|
2022-10-10 08:28:11 +02:00
|
|
|
}) => {
|
2024-09-12 13:53:04 +02:00
|
|
|
const formattedTitle = `${title} | BLS bot`
|
2021-11-29 15:19:07 +01:00
|
|
|
|
2022-10-10 08:28:11 +02:00
|
|
|
return (
|
|
|
|
<Head>
|
|
|
|
<title>{formattedTitle}</title>
|
|
|
|
<meta name="title" content={title} />
|
|
|
|
<meta property="og:title" content={title} />
|
|
|
|
<meta property="twitter:title" content={title} />
|
2021-11-29 15:19:07 +01:00
|
|
|
|
2022-10-10 08:28:11 +02:00
|
|
|
<meta name="description" content={description} />
|
|
|
|
<meta property="twitter:description" content={description} />
|
|
|
|
<meta property="og:description" content={description} />
|
2021-11-29 15:19:07 +01:00
|
|
|
|
2022-10-10 08:28:11 +02:00
|
|
|
<meta property="og:image" content={imagePreviewUrl} />
|
|
|
|
<meta property="twitter:image" content={imagePreviewUrl} />
|
|
|
|
|
|
|
|
<meta property="og:type" content="website" />
|
|
|
|
<meta property="twitter:card" content="summary_large_image" />
|
|
|
|
</Head>
|
|
|
|
)
|
|
|
|
}
|