Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

1.0 KB
Raw Blame
import { useTranslation } from 'react-i18next'
import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
import { SitemapFunction } from 'remix-sitemap'

import {
  getOgImageUrl,
  isDisableMarketingPages,
  isSelfhosted,
} from '~/lib/constants'
import Contact from '~/pages/Contact'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'

export const meta: MetaFunction = () => {
  // eslint-disable-next-line react-hooks/rules-of-hooks
  const { t } = useTranslation('common')

  return [
    ...getTitle(t('titles.contact')),
    ...getDescription(t('description.contact')),
    ...getPreviewImage(
      getOgImageUrl(t('titles.contact'), t('description.contact')),
    ),
  ]
}

export const sitemap: SitemapFunction = () => ({
  priority: 1,
  exclude: isSelfhosted || isDisableMarketingPages,
})

export async function loader() {
  if (isSelfhosted || isDisableMarketingPages) {
    return redirect('/dashboard', 302)
  }

  return null
}

export default function Index() {
  return <Contact />
}