i18n-server.tsx 441 B

12345678910111213141516171819202122
  1. import React from 'react'
  2. import I18N from './i18n'
  3. import { ToastProvider } from './base/toast'
  4. import { getLocaleOnServer } from '@/i18n/server'
  5. export type II18NServerProps = {
  6. children: React.ReactNode
  7. }
  8. const I18NServer = ({
  9. children,
  10. }: II18NServerProps) => {
  11. const locale = getLocaleOnServer()
  12. return (
  13. <I18N {...{ locale }}>
  14. <ToastProvider>{children}</ToastProvider>
  15. </I18N>
  16. )
  17. }
  18. export default I18NServer