Simple Chat Message Display
In the PhonePe app, seamless communication is key. This problem focuses on building a fundamental component of any messaging feature: displaying chat messages. You will implement a basic chat window that renders a list of messages, distinguishing between those sent by the current user and others, mirroring a common chat UI pattern.
Your task is to build a React functional component named ChatWindow that displays a list of chat messages.
messages array.currentUserId from messages sent by other users.messages array (which is chronological).currentUserId should be aligned to the right side of the chat window.mockMessages array are rendered in the ChatWindow component.name and the content.currentUserId are visually distinct and aligned to the right.Constraints
messages data will be an array of objects, each containing id, senderId, senderName, and content.currentUserId will be provided to identify the active user.messages array is already sorted chronologically.Loading editor...