Flight Status Indicator with Tooltip and Popover
In travel applications like Ixigo, displaying concise yet informative data is crucial. Flight status indicators in search results or booking details are a perfect example. While a simple label like "Delayed" is useful, users often need more details without navigating away. This problem challenges you to build an interactive flight status indicator that reveals additional information through a tooltip on hover and a more detailed popover on click.
Your primary task is to enhance the provided FlightStatusIndicator component to display dynamic information using both a tooltip and a popover.
FlightStatusIndicator component, a small tooltip should appear. This tooltip should display the statusMessage from the flight details.FlightStatusIndicator component, a larger popover should appear. This popover should display more detailed information from the flight details, such as estimatedDelay, reason, and newGate (if available).Escape key.mouseenter and disappear on mouseleave. The popover should appear on click and disappear on click-outside or Escape key press.FlightStatusIndicator displays a tooltip.statusMessage provided in the details prop.FlightStatusIndicator displays a popover.estimatedDelay, reason, and newGate from the details prop, if they exist.Escape key dismisses the popover.FlightStatusIndicator (e.g., directly above, below, or to the side).Constraints
position: absolute;). Advanced positioning logic (like auto-flipping if near screen edge) is not required.mockFlightData will be the source of truth for flight details.Loading editor...