mirror of
https://github.com/langgenius/dify.git
synced 2026-06-17 14:51:10 +08:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: hjlarry <hjlarry@163.com> Co-authored-by: fatelei <fatelei@gmail.com> Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com> Co-authored-by: gigglewang <gigglewang@dify.ai> Co-authored-by: Yunlu Wen <yunlu.wen@dify.ai> Co-authored-by: chariri <w@chariri.moe> Co-authored-by: Evan <2869018789@qq.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com>
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import type { HeaderInNormalProps } from './header-in-normal'
|
|
import type { HeaderInRestoringProps } from './header-in-restoring'
|
|
import type { HeaderInHistoryProps } from './header-in-view-history'
|
|
import dynamic from '@/next/dynamic'
|
|
import {
|
|
useWorkflowMode,
|
|
} from '../hooks'
|
|
import HeaderInNormal from './header-in-normal'
|
|
|
|
const HeaderInHistory = dynamic(() => import('./header-in-view-history'), {
|
|
ssr: false,
|
|
})
|
|
const HeaderInRestoring = dynamic(() => import('./header-in-restoring'), {
|
|
ssr: false,
|
|
})
|
|
|
|
export type HeaderProps = {
|
|
normal?: HeaderInNormalProps
|
|
viewHistory?: HeaderInHistoryProps
|
|
restoring?: HeaderInRestoringProps
|
|
}
|
|
const Header = ({
|
|
normal: normalProps,
|
|
viewHistory: viewHistoryProps,
|
|
restoring: restoringProps,
|
|
}: HeaderProps) => {
|
|
const {
|
|
normal,
|
|
restoring,
|
|
viewHistory,
|
|
} = useWorkflowMode()
|
|
|
|
return (
|
|
<div
|
|
className="absolute top-7 left-0 z-10 flex h-0 w-full items-center justify-between bg-mask-top2bottom-gray-50-to-transparent px-3"
|
|
>
|
|
{
|
|
normal && (
|
|
<HeaderInNormal
|
|
{...normalProps}
|
|
/>
|
|
)
|
|
}
|
|
{
|
|
viewHistory && (
|
|
<HeaderInHistory
|
|
{...viewHistoryProps}
|
|
/>
|
|
)
|
|
}
|
|
{
|
|
restoring && (
|
|
<HeaderInRestoring
|
|
{...restoringProps}
|
|
/>
|
|
)
|
|
}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default Header
|