Skip to content

Conversation

colin-codegen[bot]
Copy link
Contributor

@colin-codegen colin-codegen bot commented Aug 15, 2023

The proposed approach offers substantial improvements in terms of modularity and readability. It intends to split the main Chat component into several smaller functional parts. It starts by moving the API call functions getAgentReply and clearChatHistory to a new file named src/hooks/chatApi.ts. Additionally, the useMutation calls are moved to chatApi.ts too. Furthermore, the state management of messages, user inputs, along with handleScroll and submit functionality are moved into a new hook src/hooks/useMessages.ts. Lastly, the smaller components UserMessage and BotMessage are each moved to new separate files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant