dify/web/app/components/integrations/page-header.tsx
Jingyi 9b74df21d0
feat(web): refine onboarding UI (#37433)
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>
2026-06-15 08:47:15 +00:00

52 lines
1.5 KiB
TypeScript

import type { ReactNode } from 'react'
import { cn } from '@langgenius/dify-ui/cn'
type IntegrationPageHeaderProps = {
align?: 'start' | 'center'
description?: ReactNode
descriptionClassName?: string
frameClassName: string
title?: ReactNode
toolbar?: ReactNode
}
export function IntegrationPageHeader({
align = 'start',
description,
descriptionClassName,
frameClassName,
title,
toolbar,
}: IntegrationPageHeaderProps) {
const showDescription = description !== undefined && description !== null
const showToolbar = toolbar !== undefined && toolbar !== null
return (
<div className={cn('flex shrink-0', align === 'start' ? 'items-start' : 'min-h-14 items-center justify-between')}>
<div className={cn(
'flex min-w-0 flex-1',
showToolbar ? 'flex-col gap-3' : 'justify-between',
align === 'start' ? 'items-start pt-3 pb-2' : 'items-center py-2',
frameClassName,
)}
>
<div className="flex min-w-0 flex-col gap-0.5">
<div className="title-2xl-semi-bold text-text-primary">
{title}
</div>
{showDescription && (
<div className={cn(descriptionClassName ?? 'system-sm-regular', 'text-text-tertiary')}>
{description}
</div>
)}
</div>
{showToolbar && (
<div className="flex w-full items-center justify-between">
{toolbar}
</div>
)}
</div>
</div>
)
}