layout.tsx 808 B

1234567891011121314151617181920212223242526272829303132
  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. >
  22. {/* @ts-expect-error Async Server Component */}
  23. <I18nServer locale={locale}>{children}</I18nServer>
  24. </body>
  25. </html>
  26. )
  27. }
  28. export default LocaleLayout