layout.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from 'react'
  2. import type { ReactNode } from 'react'
  3. import SwrInitor from '@/app/components/swr-initor'
  4. import { AppContextProvider } from '@/context/app-context'
  5. import GA, { GaType } from '@/app/components/base/ga'
  6. import HeaderWrapper from '@/app/components/header/header-wrapper'
  7. import Header from '@/app/components/header'
  8. import { EventEmitterContextProvider } from '@/context/event-emitter'
  9. import { ProviderContextProvider } from '@/context/provider-context'
  10. import { ModalContextProvider } from '@/context/modal-context'
  11. import { TanstackQueryIniter } from '@/context/query-client'
  12. const Layout = ({ children }: { children: ReactNode }) => {
  13. return (
  14. <>
  15. <GA gaType={GaType.admin} />
  16. <SwrInitor>
  17. <TanstackQueryIniter>
  18. <AppContextProvider>
  19. <EventEmitterContextProvider>
  20. <ProviderContextProvider>
  21. <ModalContextProvider>
  22. <HeaderWrapper>
  23. <Header />
  24. </HeaderWrapper>
  25. {children}
  26. </ModalContextProvider>
  27. </ProviderContextProvider>
  28. </EventEmitterContextProvider>
  29. </AppContextProvider>
  30. </TanstackQueryIniter>
  31. </SwrInitor>
  32. </>
  33. )
  34. }
  35. export const metadata = {
  36. title: 'Dify',
  37. }
  38. export default Layout