dify/web/app/layout.tsx

60 lines
1.9 KiB
TypeScript
Raw Normal View History

import type { Viewport } from 'next'
2023-05-15 08:51:32 +08:00
import I18nServer from './components/i18n-server'
2024-09-08 13:14:11 +08:00
import BrowserInitor from './components/browser-initor'
2023-06-29 15:30:12 +08:00
import SentryInitor from './components/sentry-initor'
import Topbar from './components/base/topbar'
2023-05-15 08:51:32 +08:00
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,
2023-05-15 08:51:32 +08:00
}
const LocaleLayout = ({
children,
}: {
children: React.ReactNode
}) => {
const locale = getLocaleOnServer()
2023-06-29 15:30:12 +08:00
2023-05-15 08:51:32 +08:00
return (
<html lang={locale ?? 'en'} className="h-full" data-theme="light">
2023-11-28 20:05:19 +08:00
<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>
2023-05-15 08:51:32 +08:00
<body
2023-09-28 11:26:04 +08:00
className="h-full select-auto"
2023-05-15 08:51:32 +08:00
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-support-mail-login={process.env.NEXT_PUBLIC_SUPPORT_MAIL_LOGIN}
data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN}
2023-08-25 19:38:52 +08:00
data-public-maintenance-notice={process.env.NEXT_PUBLIC_MAINTENANCE_NOTICE}
2023-10-16 15:26:25 +08:00
data-public-site-about={process.env.NEXT_PUBLIC_SITE_ABOUT}
data-public-text-generation-timeout-ms={process.env.NEXT_PUBLIC_TEXT_GENERATION_TIMEOUT_MS}
2023-05-15 08:51:32 +08:00
>
<Topbar />
2024-09-08 13:14:11 +08:00
<BrowserInitor>
<SentryInitor>
2024-05-30 18:58:08 +08:00
<I18nServer>{children}</I18nServer>
</SentryInitor>
2024-09-08 13:14:11 +08:00
</BrowserInitor>
2023-05-15 08:51:32 +08:00
</body>
</html>
)
}
export default LocaleLayout