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

30 lines
731 B
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'
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-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-18 16:57:14 +08:00
<HeaderWrapper>
<Header />
</HeaderWrapper>
2023-06-29 15:30:12 +08:00
{children}
</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