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'
|
2023-07-18 16:57:14 +08:00
|
|
|
import HeaderWrapper from '@/app/components/header/HeaderWrapper'
|
2023-06-29 15:30:12 +08:00
|
|
|
import Header from '@/app/components/header'
|
2023-07-27 13:27:34 +08:00
|
|
|
import { EventEmitterContextProvider } from '@/context/event-emitter'
|
|
|
|
import { ProviderContextProvider } from '@/context/provider-context'
|
2023-11-06 19:36:32 +08:00
|
|
|
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>
|
2023-07-27 13:27:34 +08:00
|
|
|
<EventEmitterContextProvider>
|
|
|
|
<ProviderContextProvider>
|
2023-11-06 19:36:32 +08:00
|
|
|
<ModalContextProvider>
|
|
|
|
<HeaderWrapper>
|
|
|
|
<Header />
|
|
|
|
</HeaderWrapper>
|
|
|
|
{children}
|
|
|
|
</ModalContextProvider>
|
2023-07-27 13:27:34 +08:00
|
|
|
</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
|