Build a Simple Event Timeline Component
In many business applications, visualizing a sequence of events chronologically is crucial for understanding progress, history, or status changes. This problem focuses on building a simple, yet effective, timeline component to display key activities or milestones in a clear, sequential manner, enhancing user comprehension and interaction with historical data.
Your primary task is to develop a React component that renders a vertical timeline of events.
Timeline component: This component should accept an events array (of type TimelineEvent[]) as a prop.TimelineItem component: This sub-component should be responsible for rendering an individual event's details.TimelineItem must clearly show:
title of the event.description of the event.timestamp of the event, formatted for readability.mockEvents array provided in App.tsx is already sorted; your component should rely on this order.formatTimestamp helper function in App.tsx to display dates in a user-friendly format (e.g., "Jan 1, 2023, 10:00 AM").mockEvents array are rendered.title, description, and formatted timestamp.Constraints
styles.css). CSS-in-JS or preprocessors are not required.TimelineEvent interface) is provided and will not change.Loading editor...