Commit c09e9442 by liimin

refactor(chat): 优化聊天组件并暂时移除某些功能

- 注释掉 useChat 钩子中的未使用参数
- 移除 Copy 组件中的未使用导入
- 注释掉 Footer 组件中的未使用属性和子组件
- 调整 Chat 组件中的 Footer 渲染方式
- 移除 tsconfig.json 中的未使用文件引用
1 parent ea932c2a
...@@ -35,7 +35,7 @@ export const useChat = (installedAppInfo?: InstalledApp, inputs: Record<string, ...@@ -35,7 +35,7 @@ export const useChat = (installedAppInfo?: InstalledApp, inputs: Record<string,
const { t } = useTranslation() const { t } = useTranslation()
const { notify } = useToastContext() const { notify } = useToastContext()
const { formatTime } = useTimestamp() const { formatTime } = useTimestamp()
// const params = useParams() // const params = useParams()
const [clearChatList, setClearChatList] = useState(false) const [clearChatList, setClearChatList] = useState(false)
const [newConversationInputs, setNewConversationInputs] = useState<Record<string, any>>(inputs) const [newConversationInputs, setNewConversationInputs] = useState<Record<string, any>>(inputs)
const currentChatInstanceRef = useRef<{ handleStop: () => void }>({ const currentChatInstanceRef = useRef<{ handleStop: () => void }>({
......
...@@ -16,8 +16,8 @@ type FooterProps = { ...@@ -16,8 +16,8 @@ type FooterProps = {
const Footer: FC<FooterProps> = ({ const Footer: FC<FooterProps> = ({
chatFooterClassName, chatFooterClassName,
chatFooterInnerClassName, chatFooterInnerClassName,
isMobile, // isMobile,
suggestedQuestions, // suggestedQuestions,
// isShowPracticeButton, // isShowPracticeButton,
chatFooterRef, chatFooterRef,
chatFooterInnerRef, chatFooterInnerRef,
...@@ -31,7 +31,7 @@ const Footer: FC<FooterProps> = ({ ...@@ -31,7 +31,7 @@ const Footer: FC<FooterProps> = ({
{/* {isShowPracticeButton && <Practice />} */} {/* {isShowPracticeButton && <Practice />} */}
{ <StopResponding />} { <StopResponding />}
</div> </div>
{!!suggestedQuestions?.length && <TryToAsk suggestedQuestions={suggestedQuestions} isMobile={isMobile} />} {/* {!!suggestedQuestions?.length && <TryToAsk suggestedQuestions={suggestedQuestions} isMobile={isMobile} />} */}
{<ChatInput />} {<ChatInput />}
</div> </div>
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: liimin 17653212@qq.com * @Author: liimin 17653212@qq.com
* @Date: 2025-04-16 18:17:38 * @Date: 2025-04-16 18:17:38
* @LastEditors: limin * @LastEditors: limin
* @LastEditTime: 2025-07-14 19:34:47 * @LastEditTime: 2025-07-15 15:35:35
* @FilePath: \ai-assistant\app\components\base\chat\chat\index.tsx * @FilePath: \ai-assistant\app\components\base\chat\chat\index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -81,7 +81,6 @@ const Chat: FC<ChatProps> = () => { ...@@ -81,7 +81,6 @@ const Chat: FC<ChatProps> = () => {
<ChatBody /> <ChatBody />
</div> </div>
</div> </div>
{
<ChatFooter <ChatFooter
chatFooterRef={chatFooterRef} chatFooterRef={chatFooterRef}
chatFooterInnerRef={chatFooterInnerRef} chatFooterInnerRef={chatFooterInnerRef}
...@@ -91,7 +90,6 @@ const Chat: FC<ChatProps> = () => { ...@@ -91,7 +90,6 @@ const Chat: FC<ChatProps> = () => {
isMobile={isMobile} isMobile={isMobile}
// isShowPracticeButton={isShowPracticeButton} // isShowPracticeButton={isShowPracticeButton}
/> />
}
</div> </div>
) )
} }
......
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
"next-env.d.ts", "next-env.d.ts",
"**/*.ts", "**/*.ts",
"**/*.tsx", "**/*.tsx",
".next/types/**/*.ts", ".next/types/**/*.ts"
"app/components/develop/Prose.jsx"
], ],
"exclude": [ "exclude": [
"node_modules" "node_modules"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!