diff --git a/web/app/components/header/index.tsx b/web/app/components/header/index.tsx index 11b5859923..9149d5f69e 100644 --- a/web/app/components/header/index.tsx +++ b/web/app/components/header/index.tsx @@ -17,7 +17,7 @@ import { useDatasetsContext } from '@/context/datasets-context' const BuildAppsIcon = ({isSelected}: {isSelected: boolean}) => ( - + ) diff --git a/web/app/components/share/chat/index.tsx b/web/app/components/share/chat/index.tsx index 2fcba277a3..6d174fea20 100644 --- a/web/app/components/share/chat/index.tsx +++ b/web/app/components/share/chat/index.tsx @@ -444,6 +444,7 @@ const Main: FC = ({ currentId={currConversationId} copyRight={siteInfo.copyright || siteInfo.title} isInstalledApp={isInstalledApp} + siteInfo={siteInfo} /> ) } @@ -456,14 +457,17 @@ const Main: FC = ({ return (
-
handleConversationIdChange('-1')} - /> + {!isInstalledApp && ( +
handleConversationIdChange('-1')} + /> + )} + {/* {isNewConversation ? 'new' : 'exist'} {JSON.stringify(newConversationInputs ? newConversationInputs : {})} {JSON.stringify(existConversationInputs ? existConversationInputs : {})} */} diff --git a/web/app/components/share/chat/sidebar/app-info/index.tsx b/web/app/components/share/chat/sidebar/app-info/index.tsx new file mode 100644 index 0000000000..d3987faa90 --- /dev/null +++ b/web/app/components/share/chat/sidebar/app-info/index.tsx @@ -0,0 +1,27 @@ +'use client' +import React, { FC } from 'react' +import cn from 'classnames' +import { appDefaultIconBackground } from '@/config/index' +import AppIcon from '@/app/components/base/app-icon' + +export interface IAppInfoProps { + className?: string + icon: string + icon_background?: string + name: string +} + +const AppInfo: FC = ({ + className, + icon, + icon_background, + name +}) => { + return ( +
+ +
{name}
+
+ ) +} +export default React.memo(AppInfo) diff --git a/web/app/components/share/chat/sidebar/index.tsx b/web/app/components/share/chat/sidebar/index.tsx index 0333db8d41..e0bdc2befa 100644 --- a/web/app/components/share/chat/sidebar/index.tsx +++ b/web/app/components/share/chat/sidebar/index.tsx @@ -7,8 +7,9 @@ import { } from '@heroicons/react/24/outline' import { ChatBubbleOvalLeftEllipsisIcon as ChatBubbleOvalLeftEllipsisSolidIcon, } from '@heroicons/react/24/solid' import Button from '../../../base/button' +import AppInfo from '@/app/components/share/chat/sidebar/app-info' // import Card from './card' -import type { ConversationItem } from '@/models/share' +import type { ConversationItem, SiteInfo } from '@/models/share' function classNames(...classes: any[]) { return classes.filter(Boolean).join(' ') @@ -22,6 +23,7 @@ export type ISidebarProps = { onCurrentIdChange: (id: string) => void list: ConversationItem[] isInstalledApp: boolean + siteInfo: SiteInfo } const Sidebar: FC = ({ @@ -29,18 +31,27 @@ const Sidebar: FC = ({ currentId, onCurrentIdChange, list, - isInstalledApp + isInstalledApp, + siteInfo, }) => { const { t } = useTranslation() return (
+ {isInstalledApp && ( + + )} {list.length < MAX_CONVERSATION_LENTH && (