From ec1b7620820c3f67b041898e710b7bf52a359444 Mon Sep 17 00:00:00 2001 From: rdmclin2 Date: Sat, 23 Nov 2024 20:27:58 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/chat/Background/index.tsx | 33 ------------- src/app/chat/CameraMode/Background/index.tsx | 24 ++++++++++ .../ChatDialog/index.tsx | 0 .../ChatDialog/style.ts | 0 .../CameraMode/Operation/actions/CallOff.tsx | 26 ++++++++++ .../Operation}/actions/Record.tsx | 14 +++++- .../CameraMode/Operation/actions/Setting.tsx | 25 ++++++++++ src/app/chat/CameraMode/Operation/index.tsx | 20 ++++++++ .../Settings}/BackGroundList/index.tsx | 0 .../Market/Card/SubscribeButton.tsx | 0 .../Market/Card/UnSubscribeButton.tsx | 0 .../DanceMarketModal/Market/Card/index.tsx | 0 .../Market/CreateDanceModal/AudioUpload.tsx | 0 .../Market/CreateDanceModal/CameraUpload.tsx | 0 .../CoverImageUpload/index.tsx | 0 .../CreateDanceModal/DanceIdInput/index.tsx | 0 .../Market/CreateDanceModal/DanceName.tsx | 0 .../Market/CreateDanceModal/ReadMe/index.tsx | 0 .../Market/CreateDanceModal/SrcUpload.tsx | 0 .../Market/CreateDanceModal/index.tsx | 0 .../DanceMarketModal/Market/List/index.tsx | 0 .../DanceMarketModal/Market/index.tsx | 0 .../DanceMarketModal/Market/style.ts | 0 .../DanceList/DanceMarketModal/index.tsx | 0 .../DanceList/DanceMarketModal/style.ts | 0 .../Settings}/DanceList/Item/Actions.tsx | 0 .../Settings}/DanceList/Item/index.tsx | 0 .../Settings}/DanceList/Item/style.ts | 0 .../Settings}/DanceList/index.tsx | 0 .../Settings}/MotionList/ActionList/index.tsx | 0 .../Settings}/MotionList/SideBar/index.tsx | 0 .../Settings}/MotionList/index.tsx | 0 .../PostureList/ActionList/index.tsx | 0 .../SideBar/filters/CategoryFilter.tsx | 0 .../SideBar/filters/GenderFilter.tsx | 0 .../Settings}/PostureList/SideBar/index.tsx | 5 +- .../Settings}/PostureList/index.tsx | 0 .../Settings}/PostureList/style.ts | 0 .../Settings}/StageList/index.tsx | 0 .../Settings}/index.tsx | 40 ++++++++++------ .../{ChatInfo => CameraMode/Settings}/type.ts | 1 - src/app/chat/CameraMode/index.tsx | 47 +++++++++++++++++++ .../chat/{ViewerMode => CameraMode}/style.ts | 6 +-- .../ChatHeader/actions/ToggleChatSideBar.tsx | 23 --------- src/app/chat/ChatHeader/actions/Voice.tsx | 36 -------------- .../ChatHeader/AgentMeta/ModelSwitchPanel.tsx | 0 .../ChatHeader/AgentMeta/index.tsx | 0 .../ChatHeader/AgentMeta/style.ts | 0 .../ChatHeader/actions/Interactive.tsx | 0 .../actions/ShareButton/ChatList.tsx | 0 .../actions/ShareButton/Preview.tsx | 4 +- .../actions/ShareButton/ShareModal.tsx | 0 .../ChatHeader/actions/ShareButton/index.tsx | 0 .../ChatHeader/actions/ShareButton/style.ts | 0 .../ChatHeader/actions/ShareButton/type.ts | 0 .../ChatHeader/actions/ToggleSessionList.tsx | 0 .../chat/{ => ChatMode}/ChatHeader/index.tsx | 4 -- .../chat/{ => ChatMode}/ChatHeader/style.ts | 0 .../ChatList/AutoScroll.tsx | 0 .../ChatList/BackBottom/index.tsx | 0 .../ChatList/BackBottom/style.ts | 0 .../ChatList/SkeletonList.tsx | 0 .../ChatList/VirtualizedList.tsx | 16 ------- .../{ChatInfo => ChatMode}/ChatList/index.tsx | 0 .../{ChatInfo => ChatMode}/ChatList/style.ts | 0 .../MessageInput/TextArea.tsx | 0 .../ChatMode/MessageInput/actions/Camera.tsx | 12 +++++ .../MessageInput/actions}/History.tsx | 0 .../MessageInput/actions}/TokenMini.tsx | 0 .../MessageInput/index.tsx | 9 +++- .../MessageInput/style.ts | 0 .../SideBar/SessionList/Elsa/index.tsx | 0 .../SideBar/SessionList/List/Item/Actions.tsx | 0 .../SideBar/SessionList/List/Item/index.tsx | 0 .../SideBar/SessionList/List/SkeletonList.tsx | 0 .../SideBar/SessionList/List/index.tsx | 0 .../SideBar/SessionList/ListItem.tsx | 0 .../SideBar/SessionList/SkeletonList.tsx | 0 .../SideBar/SessionList/index.tsx | 0 src/app/chat/{ => ChatMode}/SideBar/index.tsx | 0 src/app/chat/ChatMode/index.tsx | 40 ++++++++++++++++ src/app/chat/ChatMode/style.ts | 24 ++++++++++ src/app/chat/Effect/index.tsx | 12 +++++ src/app/chat/{Background => Effect}/style.ts | 0 src/app/chat/ViewerMode/index.tsx | 43 ----------------- src/app/chat/layout.tsx | 5 +- src/app/chat/page.tsx | 25 ++++------ src/app/chat/store/chat.ts | 22 +++++++++ src/constants/token.ts | 1 + src/constants/url.ts | 2 + src/features/AgentViewer/ToolBar/index.tsx | 8 ++-- src/hooks/useScreenshot.ts | 2 +- 92 files changed, 324 insertions(+), 205 deletions(-) delete mode 100644 src/app/chat/Background/index.tsx create mode 100644 src/app/chat/CameraMode/Background/index.tsx rename src/app/chat/{ViewerMode => CameraMode}/ChatDialog/index.tsx (100%) rename src/app/chat/{ViewerMode => CameraMode}/ChatDialog/style.ts (100%) create mode 100644 src/app/chat/CameraMode/Operation/actions/CallOff.tsx rename src/app/chat/{ViewerMode/MessageInput => CameraMode/Operation}/actions/Record.tsx (69%) create mode 100644 src/app/chat/CameraMode/Operation/actions/Setting.tsx create mode 100644 src/app/chat/CameraMode/Operation/index.tsx rename src/app/chat/{ChatInfo => CameraMode/Settings}/BackGroundList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/Card/SubscribeButton.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/Card/UnSubscribeButton.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/Card/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/AudioUpload.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/CameraUpload.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/CoverImageUpload/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceIdInput/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceName.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/ReadMe/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/SrcUpload.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/CreateDanceModal/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/List/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/Market/style.ts (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/DanceMarketModal/style.ts (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/Item/Actions.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/Item/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/Item/style.ts (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/DanceList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/MotionList/ActionList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/MotionList/SideBar/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/MotionList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/PostureList/ActionList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/PostureList/SideBar/filters/CategoryFilter.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/PostureList/SideBar/filters/GenderFilter.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/PostureList/SideBar/index.tsx (89%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/PostureList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/PostureList/style.ts (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/StageList/index.tsx (100%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/index.tsx (81%) rename src/app/chat/{ChatInfo => CameraMode/Settings}/type.ts (86%) create mode 100644 src/app/chat/CameraMode/index.tsx rename src/app/chat/{ViewerMode => CameraMode}/style.ts (81%) delete mode 100644 src/app/chat/ChatHeader/actions/ToggleChatSideBar.tsx delete mode 100644 src/app/chat/ChatHeader/actions/Voice.tsx rename src/app/chat/{ => ChatMode}/ChatHeader/AgentMeta/ModelSwitchPanel.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/AgentMeta/index.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/AgentMeta/style.ts (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/Interactive.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ShareButton/ChatList.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ShareButton/Preview.tsx (94%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ShareButton/ShareModal.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ShareButton/index.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ShareButton/style.ts (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ShareButton/type.ts (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/actions/ToggleSessionList.tsx (100%) rename src/app/chat/{ => ChatMode}/ChatHeader/index.tsx (88%) rename src/app/chat/{ => ChatMode}/ChatHeader/style.ts (100%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/AutoScroll.tsx (100%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/BackBottom/index.tsx (100%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/BackBottom/style.ts (100%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/SkeletonList.tsx (100%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/VirtualizedList.tsx (84%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/index.tsx (100%) rename src/app/chat/{ChatInfo => ChatMode}/ChatList/style.ts (100%) rename src/app/chat/{ViewerMode => ChatMode}/MessageInput/TextArea.tsx (100%) create mode 100644 src/app/chat/ChatMode/MessageInput/actions/Camera.tsx rename src/app/chat/{ChatInfo/ChatList/Actions => ChatMode/MessageInput/actions}/History.tsx (100%) rename src/app/chat/{ChatInfo/ChatList/Actions => ChatMode/MessageInput/actions}/TokenMini.tsx (100%) rename src/app/chat/{ViewerMode => ChatMode}/MessageInput/index.tsx (89%) rename src/app/chat/{ViewerMode => ChatMode}/MessageInput/style.ts (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/Elsa/index.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/List/Item/Actions.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/List/Item/index.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/List/SkeletonList.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/List/index.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/ListItem.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/SkeletonList.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/SessionList/index.tsx (100%) rename src/app/chat/{ => ChatMode}/SideBar/index.tsx (100%) create mode 100644 src/app/chat/ChatMode/index.tsx create mode 100644 src/app/chat/ChatMode/style.ts create mode 100644 src/app/chat/Effect/index.tsx rename src/app/chat/{Background => Effect}/style.ts (100%) delete mode 100644 src/app/chat/ViewerMode/index.tsx create mode 100644 src/app/chat/store/chat.ts diff --git a/src/app/chat/Background/index.tsx b/src/app/chat/Background/index.tsx deleted file mode 100644 index f25e098a..00000000 --- a/src/app/chat/Background/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useGlobalStore } from '@/store/global'; -import { useSettingStore } from '@/store/setting'; - -import { useStyles } from './style'; - -const Background = () => { - const { styles } = useStyles(); - const backgroundUrl = useGlobalStore((s) => s.backgroundUrl); - const backgroundEffect = useSettingStore((s) => s.config.backgroundEffect); - - if (backgroundUrl) { - return ( -
- ); - } - - return backgroundEffect === 'glow' ?
: null; -}; - -export default Background; diff --git a/src/app/chat/CameraMode/Background/index.tsx b/src/app/chat/CameraMode/Background/index.tsx new file mode 100644 index 00000000..e327a524 --- /dev/null +++ b/src/app/chat/CameraMode/Background/index.tsx @@ -0,0 +1,24 @@ +import { useGlobalStore } from '@/store/global'; + +const Background = () => { + const backgroundUrl = useGlobalStore((s) => s.backgroundUrl); + + return backgroundUrl ? ( +
+ ) : null; +}; + +export default Background; diff --git a/src/app/chat/ViewerMode/ChatDialog/index.tsx b/src/app/chat/CameraMode/ChatDialog/index.tsx similarity index 100% rename from src/app/chat/ViewerMode/ChatDialog/index.tsx rename to src/app/chat/CameraMode/ChatDialog/index.tsx diff --git a/src/app/chat/ViewerMode/ChatDialog/style.ts b/src/app/chat/CameraMode/ChatDialog/style.ts similarity index 100% rename from src/app/chat/ViewerMode/ChatDialog/style.ts rename to src/app/chat/CameraMode/ChatDialog/style.ts diff --git a/src/app/chat/CameraMode/Operation/actions/CallOff.tsx b/src/app/chat/CameraMode/Operation/actions/CallOff.tsx new file mode 100644 index 00000000..240634e7 --- /dev/null +++ b/src/app/chat/CameraMode/Operation/actions/CallOff.tsx @@ -0,0 +1,26 @@ +import { ActionIcon } from '@lobehub/ui'; +import { useTheme } from 'antd-style'; +import { Phone } from 'lucide-react'; + +import { useChatStore } from '@/app/chat/store/chat'; +import { DESKTOP_OPERATION_ICON_SIZE } from '@/constants/token'; + +const CallOff = () => { + const [setMode] = useChatStore((s) => [s.setMode]); + const theme = useTheme(); + + return ( + setMode('chat')} + title="挂断" + size={DESKTOP_OPERATION_ICON_SIZE} + style={{ + backgroundColor: theme.colorWhite, + color: theme.colorError, + }} + /> + ); +}; + +export default CallOff; diff --git a/src/app/chat/ViewerMode/MessageInput/actions/Record.tsx b/src/app/chat/CameraMode/Operation/actions/Record.tsx similarity index 69% rename from src/app/chat/ViewerMode/MessageInput/actions/Record.tsx rename to src/app/chat/CameraMode/Operation/actions/Record.tsx index fd964983..6c302b47 100644 --- a/src/app/chat/ViewerMode/MessageInput/actions/Record.tsx +++ b/src/app/chat/CameraMode/Operation/actions/Record.tsx @@ -1,14 +1,17 @@ import { ActionIcon } from '@lobehub/ui'; +import { useTheme } from 'antd-style'; import { Mic } from 'lucide-react'; import { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; +import { DESKTOP_OPERATION_ICON_SIZE } from '@/constants/token'; import { useSpeechRecognition } from '@/hooks/useSpeechRecognition'; import { useSessionStore } from '@/store/session'; const Record = () => { const [sendMessage, setMessageInput] = useSessionStore((s) => [s.sendMessage, s.setMessageInput]); const { t } = useTranslation('chat'); + const theme = useTheme(); const handleMessageInput = useCallback( (result: string, isFinal: boolean) => { setMessageInput(result); @@ -25,7 +28,16 @@ const Record = () => { }); return ( - + ); }; diff --git a/src/app/chat/CameraMode/Operation/actions/Setting.tsx b/src/app/chat/CameraMode/Operation/actions/Setting.tsx new file mode 100644 index 00000000..eb630dfc --- /dev/null +++ b/src/app/chat/CameraMode/Operation/actions/Setting.tsx @@ -0,0 +1,25 @@ +import { ActionIcon } from '@lobehub/ui'; +import { useTheme } from 'antd-style'; +import { Box } from 'lucide-react'; +import React from 'react'; +import { useTranslation } from 'react-i18next'; + +import { DESKTOP_OPERATION_ICON_SIZE } from '@/constants/token'; +import { useGlobalStore } from '@/store/global'; + +export default () => { + const [toggleChatSideBar] = useGlobalStore((s) => [s.toggleChatSideBar]); + const theme = useTheme(); + const { t } = useTranslation('common'); + return ( + toggleChatSideBar()} + title={t('sideBar')} + size={DESKTOP_OPERATION_ICON_SIZE} + style={{ + backgroundColor: theme.colorBgElevated, + }} + /> + ); +}; diff --git a/src/app/chat/CameraMode/Operation/index.tsx b/src/app/chat/CameraMode/Operation/index.tsx new file mode 100644 index 00000000..9700c1c1 --- /dev/null +++ b/src/app/chat/CameraMode/Operation/index.tsx @@ -0,0 +1,20 @@ +'use client'; + +import { memo } from 'react'; +import { Flexbox } from 'react-layout-kit'; + +import CallOff from './actions/CallOff'; +import Record from './actions/Record'; +import Setting from './actions/Setting'; + +const VoiceOperation = memo(() => { + return ( + + + + + + ); +}); + +export default VoiceOperation; diff --git a/src/app/chat/ChatInfo/BackGroundList/index.tsx b/src/app/chat/CameraMode/Settings/BackGroundList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/BackGroundList/index.tsx rename to src/app/chat/CameraMode/Settings/BackGroundList/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/Card/SubscribeButton.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/Card/SubscribeButton.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/Card/SubscribeButton.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/Card/SubscribeButton.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/Card/UnSubscribeButton.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/Card/UnSubscribeButton.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/Card/UnSubscribeButton.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/Card/UnSubscribeButton.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/Card/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/Card/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/Card/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/Card/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/AudioUpload.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/AudioUpload.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/AudioUpload.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/AudioUpload.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/CameraUpload.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/CameraUpload.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/CameraUpload.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/CameraUpload.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/CoverImageUpload/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/CoverImageUpload/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/CoverImageUpload/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/CoverImageUpload/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceIdInput/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceIdInput/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceIdInput/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceIdInput/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceName.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceName.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceName.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/DanceName.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/ReadMe/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/ReadMe/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/ReadMe/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/ReadMe/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/SrcUpload.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/SrcUpload.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/SrcUpload.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/SrcUpload.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/CreateDanceModal/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/CreateDanceModal/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/List/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/List/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/List/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/List/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/style.ts b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/style.ts similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/Market/style.ts rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/Market/style.ts diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/DanceMarketModal/style.ts b/src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/style.ts similarity index 100% rename from src/app/chat/ChatInfo/DanceList/DanceMarketModal/style.ts rename to src/app/chat/CameraMode/Settings/DanceList/DanceMarketModal/style.ts diff --git a/src/app/chat/ChatInfo/DanceList/Item/Actions.tsx b/src/app/chat/CameraMode/Settings/DanceList/Item/Actions.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/Item/Actions.tsx rename to src/app/chat/CameraMode/Settings/DanceList/Item/Actions.tsx diff --git a/src/app/chat/ChatInfo/DanceList/Item/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/Item/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/Item/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/Item/index.tsx diff --git a/src/app/chat/ChatInfo/DanceList/Item/style.ts b/src/app/chat/CameraMode/Settings/DanceList/Item/style.ts similarity index 100% rename from src/app/chat/ChatInfo/DanceList/Item/style.ts rename to src/app/chat/CameraMode/Settings/DanceList/Item/style.ts diff --git a/src/app/chat/ChatInfo/DanceList/index.tsx b/src/app/chat/CameraMode/Settings/DanceList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/DanceList/index.tsx rename to src/app/chat/CameraMode/Settings/DanceList/index.tsx diff --git a/src/app/chat/ChatInfo/MotionList/ActionList/index.tsx b/src/app/chat/CameraMode/Settings/MotionList/ActionList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/MotionList/ActionList/index.tsx rename to src/app/chat/CameraMode/Settings/MotionList/ActionList/index.tsx diff --git a/src/app/chat/ChatInfo/MotionList/SideBar/index.tsx b/src/app/chat/CameraMode/Settings/MotionList/SideBar/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/MotionList/SideBar/index.tsx rename to src/app/chat/CameraMode/Settings/MotionList/SideBar/index.tsx diff --git a/src/app/chat/ChatInfo/MotionList/index.tsx b/src/app/chat/CameraMode/Settings/MotionList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/MotionList/index.tsx rename to src/app/chat/CameraMode/Settings/MotionList/index.tsx diff --git a/src/app/chat/ChatInfo/PostureList/ActionList/index.tsx b/src/app/chat/CameraMode/Settings/PostureList/ActionList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/PostureList/ActionList/index.tsx rename to src/app/chat/CameraMode/Settings/PostureList/ActionList/index.tsx diff --git a/src/app/chat/ChatInfo/PostureList/SideBar/filters/CategoryFilter.tsx b/src/app/chat/CameraMode/Settings/PostureList/SideBar/filters/CategoryFilter.tsx similarity index 100% rename from src/app/chat/ChatInfo/PostureList/SideBar/filters/CategoryFilter.tsx rename to src/app/chat/CameraMode/Settings/PostureList/SideBar/filters/CategoryFilter.tsx diff --git a/src/app/chat/ChatInfo/PostureList/SideBar/filters/GenderFilter.tsx b/src/app/chat/CameraMode/Settings/PostureList/SideBar/filters/GenderFilter.tsx similarity index 100% rename from src/app/chat/ChatInfo/PostureList/SideBar/filters/GenderFilter.tsx rename to src/app/chat/CameraMode/Settings/PostureList/SideBar/filters/GenderFilter.tsx diff --git a/src/app/chat/ChatInfo/PostureList/SideBar/index.tsx b/src/app/chat/CameraMode/Settings/PostureList/SideBar/index.tsx similarity index 89% rename from src/app/chat/ChatInfo/PostureList/SideBar/index.tsx rename to src/app/chat/CameraMode/Settings/PostureList/SideBar/index.tsx index e80dcd59..6cba985e 100644 --- a/src/app/chat/ChatInfo/PostureList/SideBar/index.tsx +++ b/src/app/chat/CameraMode/Settings/PostureList/SideBar/index.tsx @@ -3,12 +3,13 @@ import { ReactNode, memo } from 'react'; import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; -import CategoryFilter from '@/app/chat/ChatInfo/PostureList/SideBar/filters/CategoryFilter'; -import GenderFilter from '@/app/chat/ChatInfo/PostureList/SideBar/filters/GenderFilter'; import Header from '@/components/Header'; import { GenderEnum } from '@/types/agent'; import { PostureCategoryEnum } from '@/types/touch'; +import CategoryFilter from './filters/CategoryFilter'; +import GenderFilter from './filters/GenderFilter'; + interface IndexProps { categoryOptions: { icon: ReactNode; label: string; value: PostureCategoryEnum | undefined }[]; currentCategory: PostureCategoryEnum | undefined; diff --git a/src/app/chat/ChatInfo/PostureList/index.tsx b/src/app/chat/CameraMode/Settings/PostureList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/PostureList/index.tsx rename to src/app/chat/CameraMode/Settings/PostureList/index.tsx diff --git a/src/app/chat/ChatInfo/PostureList/style.ts b/src/app/chat/CameraMode/Settings/PostureList/style.ts similarity index 100% rename from src/app/chat/ChatInfo/PostureList/style.ts rename to src/app/chat/CameraMode/Settings/PostureList/style.ts diff --git a/src/app/chat/ChatInfo/StageList/index.tsx b/src/app/chat/CameraMode/Settings/StageList/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/StageList/index.tsx rename to src/app/chat/CameraMode/Settings/StageList/index.tsx diff --git a/src/app/chat/ChatInfo/index.tsx b/src/app/chat/CameraMode/Settings/index.tsx similarity index 81% rename from src/app/chat/ChatInfo/index.tsx rename to src/app/chat/CameraMode/Settings/index.tsx index 6d37796c..465a3d0f 100644 --- a/src/app/chat/ChatInfo/index.tsx +++ b/src/app/chat/CameraMode/Settings/index.tsx @@ -1,7 +1,8 @@ 'use client'; -import { DraggablePanel, TabsNav } from '@lobehub/ui'; +import { ActionIcon, DraggablePanel, TabsNav } from '@lobehub/ui'; import { createStyles } from 'antd-style'; +import { X } from 'lucide-react'; import dynamic from 'next/dynamic'; import { rgba } from 'polished'; import React, { useState } from 'react'; @@ -20,11 +21,6 @@ const Loading = () => ( ); -const ChatList = dynamic(() => import('./ChatList'), { - ssr: false, - loading: Loading, -}); - const BackGround = dynamic(() => import('./BackGroundList'), { ssr: false, loading: Loading, @@ -66,6 +62,15 @@ const useStyles = createStyles(({ css, token }) => ({ player: css` min-width: 480px; `, + closeIcon: css` + cursor: pointer; + margin-right: 12px; + color: ${token.colorTextSecondary}; + + &:hover { + color: ${token.colorText}; + } + `, })); export default () => { @@ -74,7 +79,7 @@ export default () => { s.setChatSidebar, ]); - const [tab, setTab] = useState(Tab.ChatList); + const [tab, setTab] = useState(Tab.DanceList); const { t } = useTranslation('chat'); const { styles } = useStyles(); @@ -84,7 +89,7 @@ export default () => { classNames={{ content: styles.content }} minWidth={CHAT_INFO_WIDTH} maxWidth={CHAT_INFO_MAX_WIDTH} - mode={'fixed'} + mode={'float'} onExpandChange={(expand) => { setChatSidebar(expand); }} @@ -93,12 +98,20 @@ export default () => { > { + setChatSidebar(false); + }} + style={{ marginLeft: 12 }} + /> + ), + }} items={[ - { - label: t('info.chat'), - key: Tab.ChatList, - }, { label: t('info.dance'), key: Tab.DanceList, @@ -125,8 +138,7 @@ export default () => { }} /> - - {tab === Tab.ChatList && } + {tab === Tab.DanceList && } {tab === Tab.Motions && } {tab === Tab.Posture && } diff --git a/src/app/chat/ChatInfo/type.ts b/src/app/chat/CameraMode/Settings/type.ts similarity index 86% rename from src/app/chat/ChatInfo/type.ts rename to src/app/chat/CameraMode/Settings/type.ts index f21b04d6..109388ba 100644 --- a/src/app/chat/ChatInfo/type.ts +++ b/src/app/chat/CameraMode/Settings/type.ts @@ -1,6 +1,5 @@ export enum Tab { Background = 'background', - ChatList = 'chats', DanceList = 'dances', Motions = 'motions', Posture = 'posture', diff --git a/src/app/chat/CameraMode/index.tsx b/src/app/chat/CameraMode/index.tsx new file mode 100644 index 00000000..4ff52cfb --- /dev/null +++ b/src/app/chat/CameraMode/index.tsx @@ -0,0 +1,47 @@ +'use client'; + +import classNames from 'classnames'; +import { isEqual } from 'lodash-es'; +import React, { memo } from 'react'; +import { Flexbox } from 'react-layout-kit'; + +import ChatDialog from '@/app/chat/CameraMode/ChatDialog'; +import { HEADER_HEIGHT } from '@/constants/token'; +import AgentViewer from '@/features/AgentViewer'; +import { sessionSelectors, useSessionStore } from '@/store/session'; + +import Background from './Background'; +import Operation from './Operation'; +import Settings from './Settings'; +import { useStyles } from './style'; + +export default memo(() => { + const { styles } = useStyles(); + const [currentAgent, interactive] = useSessionStore( + (s) => [sessionSelectors.currentAgent(s), s.interactive], + isEqual, + ); + + return ( + + + {currentAgent ? ( +
+ +
+ ) : null} + + + + + + + + +
+ ); +}); diff --git a/src/app/chat/ViewerMode/style.ts b/src/app/chat/CameraMode/style.ts similarity index 81% rename from src/app/chat/ViewerMode/style.ts rename to src/app/chat/CameraMode/style.ts index f59afe7b..455004db 100644 --- a/src/app/chat/ViewerMode/style.ts +++ b/src/app/chat/CameraMode/style.ts @@ -1,6 +1,6 @@ import { createStyles } from 'antd-style'; -import { CHAT_HEADER_HEIGHT, CHAT_INPUT_WIDTH } from '@/constants/token'; +import { CHAT_HEADER_HEIGHT } from '@/constants/token'; export const useStyles = createStyles(({ css, token }) => ({ viewer: css` @@ -27,10 +27,8 @@ export const useStyles = createStyles(({ css, token }) => ({ docker: css` z-index: 2; width: 100%; + margin-bottom: ${token.marginLG}px; padding: ${token.paddingSM}px; `, - input: css` - width: ${CHAT_INPUT_WIDTH}; - `, mask: css``, })); diff --git a/src/app/chat/ChatHeader/actions/ToggleChatSideBar.tsx b/src/app/chat/ChatHeader/actions/ToggleChatSideBar.tsx deleted file mode 100644 index 97d4462e..00000000 --- a/src/app/chat/ChatHeader/actions/ToggleChatSideBar.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { ActionIcon } from '@lobehub/ui'; -import { PanelRightClose, PanelRightOpen } from 'lucide-react'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; - -import { DESKTOP_HEADER_ICON_SIZE } from '@/constants/token'; -import { useGlobalStore } from '@/store/global'; - -export default () => { - const [showChatSidebar, toggleChatSideBar] = useGlobalStore((s) => [ - s.showChatSidebar, - s.toggleChatSideBar, - ]); - const { t } = useTranslation('common'); - return ( - toggleChatSideBar()} - title={t('sideBar')} - size={DESKTOP_HEADER_ICON_SIZE} - /> - ); -}; diff --git a/src/app/chat/ChatHeader/actions/Voice.tsx b/src/app/chat/ChatHeader/actions/Voice.tsx deleted file mode 100644 index 8858f5ee..00000000 --- a/src/app/chat/ChatHeader/actions/Voice.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { ActionIcon } from '@lobehub/ui'; -import { createStyles } from 'antd-style'; -import classNames from 'classnames'; -import { Volume2, VolumeXIcon } from 'lucide-react'; -import { useTranslation } from 'react-i18next'; - -import { DESKTOP_HEADER_ICON_SIZE } from '@/constants/token'; -import { toggleVoice } from '@/services/chat'; -import { useSessionStore } from '@/store/session'; - -const useStyles = createStyles(({ token, css }) => ({ - voice: css` - cursor: pointer; - transition: color 0.3s; - `, - voiceOn: css` - color: ${token.colorLinkActive}; - `, -})); - -const VoiceSwitch = () => { - const { styles } = useStyles(); - const [voiceOn] = useSessionStore((s) => [s.voiceOn]); - const { t } = useTranslation('chat'); - return ( - - ); -}; - -export default VoiceSwitch; diff --git a/src/app/chat/ChatHeader/AgentMeta/ModelSwitchPanel.tsx b/src/app/chat/ChatMode/ChatHeader/AgentMeta/ModelSwitchPanel.tsx similarity index 100% rename from src/app/chat/ChatHeader/AgentMeta/ModelSwitchPanel.tsx rename to src/app/chat/ChatMode/ChatHeader/AgentMeta/ModelSwitchPanel.tsx diff --git a/src/app/chat/ChatHeader/AgentMeta/index.tsx b/src/app/chat/ChatMode/ChatHeader/AgentMeta/index.tsx similarity index 100% rename from src/app/chat/ChatHeader/AgentMeta/index.tsx rename to src/app/chat/ChatMode/ChatHeader/AgentMeta/index.tsx diff --git a/src/app/chat/ChatHeader/AgentMeta/style.ts b/src/app/chat/ChatMode/ChatHeader/AgentMeta/style.ts similarity index 100% rename from src/app/chat/ChatHeader/AgentMeta/style.ts rename to src/app/chat/ChatMode/ChatHeader/AgentMeta/style.ts diff --git a/src/app/chat/ChatHeader/actions/Interactive.tsx b/src/app/chat/ChatMode/ChatHeader/actions/Interactive.tsx similarity index 100% rename from src/app/chat/ChatHeader/actions/Interactive.tsx rename to src/app/chat/ChatMode/ChatHeader/actions/Interactive.tsx diff --git a/src/app/chat/ChatHeader/actions/ShareButton/ChatList.tsx b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/ChatList.tsx similarity index 100% rename from src/app/chat/ChatHeader/actions/ShareButton/ChatList.tsx rename to src/app/chat/ChatMode/ChatHeader/actions/ShareButton/ChatList.tsx diff --git a/src/app/chat/ChatHeader/actions/ShareButton/Preview.tsx b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/Preview.tsx similarity index 94% rename from src/app/chat/ChatHeader/actions/ShareButton/Preview.tsx rename to src/app/chat/ChatMode/ChatHeader/actions/ShareButton/Preview.tsx index d9b72472..797c2b6e 100644 --- a/src/app/chat/ChatHeader/actions/ShareButton/Preview.tsx +++ b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/Preview.tsx @@ -5,8 +5,8 @@ import { Flexbox } from 'react-layout-kit'; import { DEFAULT_CHAT_MODEL } from '@/constants/agent'; import useSessionContext from '@/hooks/useSessionContext'; +import { siteUrl } from '@/server/utils/url'; -import pkg from '../../../../../../package.json'; import ChatList from './ChatList'; import { useStyles } from './style'; import { FieldType } from './type'; @@ -41,7 +41,7 @@ const Preview = memo( {withFooter ? ( -
{pkg.homepage}
+
{siteUrl}
) : (
diff --git a/src/app/chat/ChatHeader/actions/ShareButton/ShareModal.tsx b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/ShareModal.tsx similarity index 100% rename from src/app/chat/ChatHeader/actions/ShareButton/ShareModal.tsx rename to src/app/chat/ChatMode/ChatHeader/actions/ShareButton/ShareModal.tsx diff --git a/src/app/chat/ChatHeader/actions/ShareButton/index.tsx b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/index.tsx similarity index 100% rename from src/app/chat/ChatHeader/actions/ShareButton/index.tsx rename to src/app/chat/ChatMode/ChatHeader/actions/ShareButton/index.tsx diff --git a/src/app/chat/ChatHeader/actions/ShareButton/style.ts b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/style.ts similarity index 100% rename from src/app/chat/ChatHeader/actions/ShareButton/style.ts rename to src/app/chat/ChatMode/ChatHeader/actions/ShareButton/style.ts diff --git a/src/app/chat/ChatHeader/actions/ShareButton/type.ts b/src/app/chat/ChatMode/ChatHeader/actions/ShareButton/type.ts similarity index 100% rename from src/app/chat/ChatHeader/actions/ShareButton/type.ts rename to src/app/chat/ChatMode/ChatHeader/actions/ShareButton/type.ts diff --git a/src/app/chat/ChatHeader/actions/ToggleSessionList.tsx b/src/app/chat/ChatMode/ChatHeader/actions/ToggleSessionList.tsx similarity index 100% rename from src/app/chat/ChatHeader/actions/ToggleSessionList.tsx rename to src/app/chat/ChatMode/ChatHeader/actions/ToggleSessionList.tsx diff --git a/src/app/chat/ChatHeader/index.tsx b/src/app/chat/ChatMode/ChatHeader/index.tsx similarity index 88% rename from src/app/chat/ChatHeader/index.tsx rename to src/app/chat/ChatMode/ChatHeader/index.tsx index ca63266f..90e5e1fc 100644 --- a/src/app/chat/ChatHeader/index.tsx +++ b/src/app/chat/ChatMode/ChatHeader/index.tsx @@ -7,9 +7,7 @@ import React from 'react'; import { Flexbox } from 'react-layout-kit'; import ShareButton from './actions/ShareButton'; -import ToggleChatSideBar from './actions/ToggleChatSideBar'; import ToggleSessionList from './actions/ToggleSessionList'; -import Voice from './actions/Voice'; import { useStyles } from './style'; const AgentMeta = dynamic(() => import('./AgentMeta'), { @@ -48,9 +46,7 @@ export default (props: Props) => {
- -
); diff --git a/src/app/chat/ChatHeader/style.ts b/src/app/chat/ChatMode/ChatHeader/style.ts similarity index 100% rename from src/app/chat/ChatHeader/style.ts rename to src/app/chat/ChatMode/ChatHeader/style.ts diff --git a/src/app/chat/ChatInfo/ChatList/AutoScroll.tsx b/src/app/chat/ChatMode/ChatList/AutoScroll.tsx similarity index 100% rename from src/app/chat/ChatInfo/ChatList/AutoScroll.tsx rename to src/app/chat/ChatMode/ChatList/AutoScroll.tsx diff --git a/src/app/chat/ChatInfo/ChatList/BackBottom/index.tsx b/src/app/chat/ChatMode/ChatList/BackBottom/index.tsx similarity index 100% rename from src/app/chat/ChatInfo/ChatList/BackBottom/index.tsx rename to src/app/chat/ChatMode/ChatList/BackBottom/index.tsx diff --git a/src/app/chat/ChatInfo/ChatList/BackBottom/style.ts b/src/app/chat/ChatMode/ChatList/BackBottom/style.ts similarity index 100% rename from src/app/chat/ChatInfo/ChatList/BackBottom/style.ts rename to src/app/chat/ChatMode/ChatList/BackBottom/style.ts diff --git a/src/app/chat/ChatInfo/ChatList/SkeletonList.tsx b/src/app/chat/ChatMode/ChatList/SkeletonList.tsx similarity index 100% rename from src/app/chat/ChatInfo/ChatList/SkeletonList.tsx rename to src/app/chat/ChatMode/ChatList/SkeletonList.tsx diff --git a/src/app/chat/ChatInfo/ChatList/VirtualizedList.tsx b/src/app/chat/ChatMode/ChatList/VirtualizedList.tsx similarity index 84% rename from src/app/chat/ChatInfo/ChatList/VirtualizedList.tsx rename to src/app/chat/ChatMode/ChatList/VirtualizedList.tsx index 8757262c..bb9ac980 100644 --- a/src/app/chat/ChatInfo/ChatList/VirtualizedList.tsx +++ b/src/app/chat/ChatMode/ChatList/VirtualizedList.tsx @@ -1,17 +1,12 @@ -import { Space } from 'antd'; import classNames from 'classnames'; import isEqual from 'fast-deep-equal'; import React, { memo, useEffect, useRef, useState } from 'react'; -import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; import { Virtuoso, VirtuosoHandle } from 'react-virtuoso'; -import Header from '@/components/Header'; import Item from '@/features/ChatItem'; import { sessionSelectors, useSessionStore } from '@/store/session'; -import History from './Actions/History'; -import TokenMini from './Actions/TokenMini'; import AutoScroll from './AutoScroll'; import { useStyles } from './style'; @@ -32,7 +27,6 @@ const VirtualizedList = memo(({ mobile, className, style } const virtuosoRef = useRef(null); const [atBottom, setAtBottom] = useState(true); const { styles } = useStyles(); - const { t } = useTranslation('chat'); const data = useSessionStore( (s) => ['empty', ...sessionSelectors.currentChatIDsWithGreetingMessage(s)], @@ -52,16 +46,6 @@ const VirtualizedList = memo(({ mobile, className, style } // @ts-ignore return chatLoading && data.length === 2 ? null : ( -
- - - - } - /> { + const [setMode] = useChatStore((s) => [s.setMode]); + + return setMode('camera')} title="视频通话" />; +}; + +export default Camera; diff --git a/src/app/chat/ChatInfo/ChatList/Actions/History.tsx b/src/app/chat/ChatMode/MessageInput/actions/History.tsx similarity index 100% rename from src/app/chat/ChatInfo/ChatList/Actions/History.tsx rename to src/app/chat/ChatMode/MessageInput/actions/History.tsx diff --git a/src/app/chat/ChatInfo/ChatList/Actions/TokenMini.tsx b/src/app/chat/ChatMode/MessageInput/actions/TokenMini.tsx similarity index 100% rename from src/app/chat/ChatInfo/ChatList/Actions/TokenMini.tsx rename to src/app/chat/ChatMode/MessageInput/actions/TokenMini.tsx diff --git a/src/app/chat/ViewerMode/MessageInput/index.tsx b/src/app/chat/ChatMode/MessageInput/index.tsx similarity index 89% rename from src/app/chat/ViewerMode/MessageInput/index.tsx rename to src/app/chat/ChatMode/MessageInput/index.tsx index c2ef7070..49e993df 100644 --- a/src/app/chat/ViewerMode/MessageInput/index.tsx +++ b/src/app/chat/ChatMode/MessageInput/index.tsx @@ -13,7 +13,9 @@ import { useSessionStore } from '@/store/session'; import { isMacOS } from '@/utils/platform'; import TextArea from './TextArea'; -import Record from './actions/Record'; +import Camera from './actions/Camera'; +import History from './actions/History'; +import TokenMini from './actions/TokenMini'; import { useStyles } from './style'; interface InputAreaProps { @@ -61,6 +63,9 @@ const InputArea = memo((props: InputAreaProps) => { return ( + + +