Files
gsfdc/demo-dify/dify/web/app/components/integrations/page-header.tsx
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

59 lines
1.6 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 w-full min-w-0 flex-col gap-0.5">
<h1 className="title-2xl-semi-bold text-text-primary">{title}</h1>
{showDescription && (
<div
className={cn(
descriptionClassName ?? 'system-sm-regular',
'max-w-full min-w-0 text-text-tertiary',
)}
>
{description}
</div>
)}
</div>
{showToolbar && (
<div className="flex w-full min-w-0 items-center justify-between">{toolbar}</div>
)}
</div>
</div>
)
}