Build a Redux Toolkit–based ChatBox component in React for the Safarte chatbot system.
This component will manage chat messages (send + receive) using Redux state and communicate with backend APIs (/api/chat/send and /api/chat/history/:userId).
Requirements:
Create chatSlice.js using Redux Toolkit to handle fetching and sending chat messages.
Create ChatBox.jsx component connected to Redux store.
Display chat messages dynamically with simple UI (Tailwind CSS).
Add input field and Send button to send messages.
Ensure chat history loads automatically on component mount.
Build a Redux Toolkit–based ChatBox component in React for the Safarte chatbot system.
This component will manage chat messages (send + receive) using Redux state and communicate with backend APIs (/api/chat/send and /api/chat/history/:userId).
Requirements:
Create chatSlice.js using Redux Toolkit to handle fetching and sending chat messages.
Create ChatBox.jsx component connected to Redux store.
Display chat messages dynamically with simple UI (Tailwind CSS).
Add input field and Send button to send messages.
Ensure chat history loads automatically on component mount.