File size: 1,852 Bytes
4304c6d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import type { Viewport } from 'next'
import I18nServer from './components/i18n-server'
import BrowerInitor from './components/browser-initor'
import SentryInitor from './components/sentry-initor'
import Topbar from './components/base/topbar'
import { getLocaleOnServer } from '@/i18n/server'
import './styles/globals.css'
import './styles/markdown.scss'

export const metadata = {
  title: 'Dify',
}

export const viewport: Viewport = {
  width: 'device-width',
  initialScale: 1,
  maximumScale: 1,
  viewportFit: 'cover',
  userScalable: false,
}

const LocaleLayout = ({

  children,

}: {

  children: React.ReactNode

}) => {
  const locale = getLocaleOnServer()

  return (
    <html lang={locale ?? 'en'} className="h-full">

      <head>

        <meta name="theme-color" content="#FFFFFF" />

        <meta name="mobile-web-app-capable" content="yes" />

        <meta name="apple-mobile-web-app-capable" content="yes" />

        <meta name="apple-mobile-web-app-status-bar-style" content="default" />

      </head>

      <body

        className="h-full select-auto"

        data-api-prefix={process.env.NEXT_PUBLIC_API_PREFIX}

        data-pubic-api-prefix={process.env.NEXT_PUBLIC_PUBLIC_API_PREFIX}

        data-public-edition={process.env.NEXT_PUBLIC_EDITION}

        data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN}

        data-public-maintenance-notice={process.env.NEXT_PUBLIC_MAINTENANCE_NOTICE}

        data-public-site-about={process.env.NEXT_PUBLIC_SITE_ABOUT}

      >

        <Topbar/>

        <BrowerInitor>

          <SentryInitor>

            {/* @ts-expect-error Async Server Component */}

            <I18nServer locale={locale}>{children}</I18nServer>

          </SentryInitor>

        </BrowerInitor>

      </body>

    </html>
  )
}

export default LocaleLayout