dify/web/app/(commonLayout)/layout.tsx

39 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-06-29 15:30:12 +08:00
import React from 'react'
import type { ReactNode } from 'react'
import SwrInitor from '@/app/components/swr-initor'
import { AppContextProvider } from '@/context/app-context'
2023-05-15 08:51:32 +08:00
import GA, { GaType } from '@/app/components/base/ga'
2024-07-23 17:11:02 +08:00
import HeaderWrapper from '@/app/components/header/header-wrapper'
2023-06-29 15:30:12 +08:00
import Header from '@/app/components/header'
import { EventEmitterContextProvider } from '@/context/event-emitter'
import { ProviderContextProvider } from '@/context/provider-context'
import { ModalContextProvider } from '@/context/modal-context'
2023-05-15 08:51:32 +08:00
2023-06-29 15:30:12 +08:00
const Layout = ({ children }: { children: ReactNode }) => {
2023-05-15 08:51:32 +08:00
return (
<>
<GA gaType={GaType.admin} />
2023-06-29 15:30:12 +08:00
<SwrInitor>
<AppContextProvider>
<EventEmitterContextProvider>
<ProviderContextProvider>
<ModalContextProvider>
<HeaderWrapper>
<Header />
</HeaderWrapper>
{children}
</ModalContextProvider>
</ProviderContextProvider>
</EventEmitterContextProvider>
2023-06-29 15:30:12 +08:00
</AppContextProvider>
</SwrInitor>
2023-05-15 08:51:32 +08:00
</>
)
}
export const metadata = {
title: 'Dify',
}
2023-06-29 15:30:12 +08:00
export default Layout