Build a Basic Chat Message Display
In modern applications, real-time communication is crucial. A well-designed chat interface is fundamental to user engagement. This problem focuses on building the core message display component of a chat application, ensuring messages are clearly presented and distinguished between senders. This exercise will test your ability to structure UI components, manage data display, and apply styling effectively.
Your task is to build a React component that displays a list of chat messages based on provided mock data.
mockMessages array in chronological order.currentUser from messages sent by other participants.currentUser should be right-aligned within their container. Messages from other users should be left-aligned.currentUser should have a distinct background color (e.g., light blue) and text color.mockMessages are rendered on the screen.senderName, content, and a formatted timestamp.currentUser (ID matching currentUserId) are right-aligned.currentUser have a visually distinct background color.Constraints
mockMessages array and currentUserId constant.Loading editor...