Initial commit
This commit is contained in:
32
web/app/layout.tsx
Normal file
32
web/app/layout.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import I18nServer from './components/i18n-server'
|
||||
import { getLocaleOnServer } from '@/i18n/server'
|
||||
|
||||
import './styles/globals.css'
|
||||
import './styles/markdown.scss'
|
||||
|
||||
export const metadata = {
|
||||
title: 'Dify',
|
||||
}
|
||||
|
||||
const LocaleLayout = ({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) => {
|
||||
const locale = getLocaleOnServer()
|
||||
return (
|
||||
<html lang={locale ?? 'en'} className="h-full">
|
||||
<body
|
||||
className="h-full"
|
||||
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}
|
||||
>
|
||||
{/* @ts-expect-error Async Server Component */}
|
||||
<I18nServer locale={locale}>{children}</I18nServer>
|
||||
</body>
|
||||
</html>
|
||||
)
|
||||
}
|
||||
|
||||
export default LocaleLayout
|
Reference in New Issue
Block a user