layout.tsx 876 B

12345678910111213141516171819202122232425262728293031323334
  1. import I18nServer from './components/i18n-server'
  2. import { getLocaleOnServer } from '@/i18n/server'
  3. import './styles/globals.css'
  4. import './styles/markdown.scss'
  5. export const metadata = {
  6. title: 'Dify',
  7. }
  8. const LocaleLayout = ({
  9. children,
  10. }: {
  11. children: React.ReactNode
  12. }) => {
  13. const locale = getLocaleOnServer()
  14. return (
  15. <html lang={locale ?? 'en'} className="h-full">
  16. <body
  17. className="h-full"
  18. data-api-prefix={process.env.NEXT_PUBLIC_API_PREFIX}
  19. data-pubic-api-prefix={process.env.NEXT_PUBLIC_PUBLIC_API_PREFIX}
  20. data-public-edition={process.env.NEXT_PUBLIC_EDITION}
  21. data-public-sentry-dsn={process.env.NEXT_PUBLIC_SENTRY_DSN}
  22. >
  23. {/* @ts-expect-error Async Server Component */}
  24. <I18nServer locale={locale}>{children}</I18nServer>
  25. </body>
  26. </html>
  27. )
  28. }
  29. export default LocaleLayout