dify/web/app/components/workflow/header/index.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

37 lines
1.2 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