dify/web/app/components/workflow/header/index.tsx
zxhlyh efe5db38ee
Some checks are pending
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/amd64, build-api-amd64) (push) Waiting to run
Build and Push API & Web / build (api, DIFY_API_IMAGE_NAME, linux/arm64, build-api-arm64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/amd64, build-web-amd64) (push) Waiting to run
Build and Push API & Web / build (web, DIFY_WEB_IMAGE_NAME, linux/arm64, build-web-arm64) (push) Waiting to run
Build and Push API & Web / create-manifest (api, DIFY_API_IMAGE_NAME, merge-api-images) (push) Blocked by required conditions
Build and Push API & Web / create-manifest (web, DIFY_WEB_IMAGE_NAME, merge-web-images) (push) Blocked by required conditions
Chore/slice workflow (#18351)
2025-04-18 13:59:12 +08:00

52 lines
1.1 KiB
TypeScript

import {
useWorkflowMode,
} from '../hooks'
import type { HeaderInNormalProps } from './header-in-normal'
import HeaderInNormal from './header-in-normal'
import HeaderInHistory from './header-in-view-history'
import type { HeaderInRestoringProps } from './header-in-restoring'
import HeaderInRestoring from './header-in-restoring'
export type HeaderProps = {
normal?: HeaderInNormalProps
restoring?: HeaderInRestoringProps
}
const Header = ({
normal: normalProps,
restoring: restoringProps,
}: HeaderProps) => {
const {
normal,
restoring,
viewHistory,
} = useWorkflowMode()
return (
<div
className='absolute left-0 top-0 z-10 flex h-14 w-full items-center justify-between bg-mask-top2bottom-gray-50-to-transparent px-3'
>
{
normal && (
<HeaderInNormal
{...normalProps}
/>
)
}
{
viewHistory && (
<HeaderInHistory />
)
}
{
restoring && (
<HeaderInRestoring
{...restoringProps}
/>
)
}
</div>
)
}
export default Header