mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-06 15:36:21 +00:00
kb
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { Flex, useTheme, Box } from '@chakra-ui/react';
|
||||
import { useGlobalStore } from '@/store/global';
|
||||
import MyIcon from '@/components/Icon';
|
||||
@@ -8,18 +8,20 @@ import ToolMenu from './ToolMenu';
|
||||
import { ChatItemType } from '@/types/chat';
|
||||
|
||||
const ChatHeader = ({
|
||||
title,
|
||||
history,
|
||||
appName,
|
||||
appAvatar,
|
||||
onOpenSlider
|
||||
}: {
|
||||
title: string;
|
||||
history: ChatItemType[];
|
||||
appName: string;
|
||||
appAvatar: string;
|
||||
onOpenSlider: () => void;
|
||||
}) => {
|
||||
const theme = useTheme();
|
||||
const { isPc } = useGlobalStore();
|
||||
const title = useMemo(() => {}, []);
|
||||
|
||||
return (
|
||||
<Flex
|
||||
alignItems={'center'}
|
||||
@@ -32,11 +34,11 @@ const ChatHeader = ({
|
||||
{isPc ? (
|
||||
<>
|
||||
<Box mr={3} color={'myGray.1000'}>
|
||||
{title}
|
||||
{appName}
|
||||
</Box>
|
||||
<Tag display={'flex'}>
|
||||
<MyIcon name={'history'} w={'14px'} />
|
||||
<Box ml={1}>{history.length}条记录</Box>
|
||||
<Box ml={1}>{history.length === 0 ? '新的对话' : `${history.length}条记录`}</Box>
|
||||
</Tag>
|
||||
<Box flex={1} />
|
||||
</>
|
||||
@@ -46,7 +48,7 @@ const ChatHeader = ({
|
||||
<Flex px={3} alignItems={'center'} flex={'1 0 0'} w={0} justifyContent={'center'}>
|
||||
<Avatar src={appAvatar} w={'16px'} />
|
||||
<Box ml={1} className="textEllipsis">
|
||||
{title}
|
||||
{appName}
|
||||
</Box>
|
||||
</Flex>
|
||||
</>
|
||||
|
@@ -77,7 +77,7 @@ const ChatHistorySlider = ({
|
||||
}
|
||||
>
|
||||
<Avatar src={appAvatar} />
|
||||
<Box ml={2} fontWeight={'bold'} className={'textEllipsis'}>
|
||||
<Box flex={'1 0 0'} w={0} ml={2} fontWeight={'bold'} className={'textEllipsis'}>
|
||||
{appName}
|
||||
</Box>
|
||||
</Flex>
|
||||
|
@@ -288,7 +288,7 @@ const Chat = () => {
|
||||
{/* header */}
|
||||
<ChatHeader
|
||||
appAvatar={chatData.app.avatar}
|
||||
title={chatData.app.name}
|
||||
appName={chatData.app.name}
|
||||
history={chatData.history}
|
||||
onOpenSlider={onOpenSlider}
|
||||
/>
|
||||
|
@@ -184,7 +184,7 @@ const ShareChat = ({ shareId, historyId }: { shareId: string; historyId: string
|
||||
{/* header */}
|
||||
<ChatHeader
|
||||
appAvatar={shareChatData.app.avatar}
|
||||
title={shareChatData.history.title}
|
||||
appName={shareChatData.history.title}
|
||||
history={shareChatData.history.chats}
|
||||
onOpenSlider={onOpenSlider}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user