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,
const { t } = useTranslation()
const { notify } = useToastContext()
const { formatTime } = useTimestamp()
// const params = useParams()
// const params = useParams()
const [clearChatList, setClearChatList] = useState(false)
const [newConversationInputs, setNewConversationInputs] = useState<Record<string, any>>(inputs)
const currentChatInstanceRef = useRef<{ handleStop: () => void }>({
......@@ -559,11 +559,11 @@ export const useChat = (installedAppInfo?: InstalledApp, inputs: Record<string,
notify,
handleResponding,
formatTime,
// params.token,
// params.appId,
// pathname,
// params.token,
// params.appId,
// pathname,
// formSettings,
// chatList,
// chatList,
],
)
......
......@@ -22,4 +22,4 @@ const Copy: FC = memo(() => {
)
})
export default Copy
\ No newline at end of file
export default Copy
......@@ -16,8 +16,8 @@ type FooterProps = {
const Footer: FC<FooterProps> = ({
chatFooterClassName,
chatFooterInnerClassName,
isMobile,
suggestedQuestions,
// isMobile,
// suggestedQuestions,
// isShowPracticeButton,
chatFooterRef,
chatFooterInnerRef,
......@@ -31,7 +31,7 @@ const Footer: FC<FooterProps> = ({
{/* {isShowPracticeButton && <Practice />} */}
{ <StopResponding />}
</div>
{!!suggestedQuestions?.length && <TryToAsk suggestedQuestions={suggestedQuestions} isMobile={isMobile} />}
{/* {!!suggestedQuestions?.length && <TryToAsk suggestedQuestions={suggestedQuestions} isMobile={isMobile} />} */}
{<ChatInput />}
</div>
</div>
......
......@@ -2,7 +2,7 @@
* @Author: liimin 17653212@qq.com
* @Date: 2025-04-16 18:17:38
* @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
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
......@@ -81,17 +81,15 @@ const Chat: FC<ChatProps> = () => {
<ChatBody />
</div>
</div>
{
<ChatFooter
chatFooterRef={chatFooterRef}
chatFooterInnerRef={chatFooterInnerRef}
chatFooterClassName={chatFooterClassName}
chatFooterInnerClassName={chatFooterInnerClassName}
suggestedQuestions={[]}
isMobile={isMobile}
// isShowPracticeButton={isShowPracticeButton}
/>
}
<ChatFooter
chatFooterRef={chatFooterRef}
chatFooterInnerRef={chatFooterInnerRef}
chatFooterClassName={chatFooterClassName}
chatFooterInnerClassName={chatFooterInnerClassName}
suggestedQuestions={[]}
isMobile={isMobile}
// isShowPracticeButton={isShowPracticeButton}
/>
</div>
)
}
......
......@@ -33,8 +33,7 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"app/components/develop/Prose.jsx"
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!