Interactive Flight Itinerary Tree View
Flight booking often involves complex multi-leg journeys, and presenting this information clearly and interactively is crucial for user experience. This problem challenges you to build a reusable component that displays a hierarchical flight itinerary in a collapsible tree-like structure, allowing users to easily navigate and understand their journey details.
Your primary task is to implement the ItineraryTreeView component that visualizes a given hierarchical flight itinerary.
itineraryData (an array of TreeNode objects) as a nested list, representing the hierarchical nature of the flight journey.label. If details are provided, display them as secondary information.Journey > Leg > Segment).▶ for collapsed, ▼ for expanded) or similar visual elements.Journey nodes are rendered at the top level.Leg nodes are indented relative to their parent Journey node.Segment nodes are indented relative to their parent Leg node.label.details, they are displayed alongside the label.Journey nodes correctly.Constraints
TreeNode interface provided.Loading editor...