Build a Simple Chat Message Display
At Airbnb, clear and efficient communication between guests and hosts is paramount. Our messaging system is a core component of the booking experience, ensuring all details are ironed out before, during, and after a stay. This problem focuses on building a fundamental piece of that system: displaying a list of chat messages.
Your task is to implement a basic chat message list UI, rendering a series of messages and visually distinguishing between messages sent by the current user and messages sent by another party. This exercise will test your ability to render dynamic lists, apply conditional styling, and manage basic UI layout in React.
Your primary goal is to render the provided mock chat messages in a user-friendly list. Specifically, you must:
MOCK_MESSAGES array and render each message.senderName and the content.CURRENT_USER_ID from those sent by other participants. For example, messages from the current user could be right-aligned with a distinct background color, while others are left-aligned with a different background.MOCK_MESSAGES array (which is already chronological).MOCK_MESSAGES data.senderName and content.CURRENT_USER_ID are visually distinct (e.g., different background color, alignment) from messages sent by others.Constraints
MOCK_MESSAGES in App.tsx. You do not need to fetch data.styles.css.Loading editor...