| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | import I18nServer from './components/i18n-server' | 
					
						
							| 
									
										
										
										
											2023-07-18 09:45:17 +08:00
										 |  |  | import BrowerInitor from './components/browser-initor' | 
					
						
							| 
									
										
										
										
											2023-06-29 15:30:12 +08:00
										 |  |  | import SentryInitor from './components/sentry-initor' | 
					
						
							| 
									
										
										
										
											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', | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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"> | 
					
						
							|  |  |  |       <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} | 
					
						
							| 
									
										
										
										
											2023-06-13 16:04:54 +08:00
										 |  |  |         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-05-15 08:51:32 +08:00
										 |  |  |       > | 
					
						
							| 
									
										
										
										
											2023-07-18 09:45:17 +08:00
										 |  |  |         <BrowerInitor> | 
					
						
							|  |  |  |           <SentryInitor> | 
					
						
							|  |  |  |             {/* @ts-expect-error Async Server Component */} | 
					
						
							|  |  |  |             <I18nServer locale={locale}>{children}</I18nServer> | 
					
						
							|  |  |  |           </SentryInitor> | 
					
						
							|  |  |  |         </BrowerInitor> | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |       </body> | 
					
						
							|  |  |  |     </html> | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default LocaleLayout |