layout.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. const Layout = ({ children }: { children: ReactNode }) => {
  12. return (
  13. <>
  14. <GA gaType={GaType.admin} />
  15. <SwrInitor>
  16. <AppContextProvider>
  17. <EventEmitterContextProvider>
  18. <ProviderContextProvider>
  19. <ModalContextProvider>
  20. <HeaderWrapper>
  21. <Header />
  22. </HeaderWrapper>
  23. {children}
  24. </ModalContextProvider>
  25. </ProviderContextProvider>
  26. </EventEmitterContextProvider>
  27. </AppContextProvider>
  28. </SwrInitor>
  29. </>
  30. )
  31. }
  32. export const metadata = {
  33. title: 'Dify',
  34. }
  35. export default Layout