dify/web/app/components/share/header.tsx

43 lines
1019 B
TypeScript
Raw Normal View History

2023-05-15 08:51:32 +08:00
import type { FC } from 'react'
import React from 'react'
import AppIcon from '@/app/components/base/app-icon'
export type IHeaderProps = {
title: string
2023-05-19 17:36:44 +08:00
icon: string
icon_background: string
2023-05-15 08:51:32 +08:00
isMobile?: boolean
isEmbedScene?: boolean
2023-05-15 08:51:32 +08:00
}
const Header: FC<IHeaderProps> = ({
title,
isMobile,
2023-05-19 17:36:44 +08:00
icon,
icon_background,
isEmbedScene = false,
2023-05-15 08:51:32 +08:00
}) => {
return !isMobile
? null
: (
<div
className={`shrink-0 flex items-center justify-between h-12 px-3 bg-gray-100 ${
isEmbedScene ? 'bg-gradient-to-r from-blue-600 to-sky-500' : ''
}`}
>
<div></div>
<div className="flex items-center space-x-2">
<AppIcon size="small" icon={icon} background={icon_background} />
<div
className={`text-sm text-gray-800 font-bold ${
isEmbedScene ? 'text-white' : ''
}`}
>
{title}
</div>
2023-05-15 08:51:32 +08:00
</div>
<div></div>
2023-05-15 08:51:32 +08:00
</div>
)
2023-05-15 08:51:32 +08:00
}
export default React.memo(Header)