Dynamic Tabbed Content Display
On many Amazon retail pages, a vast amount of product information needs to be presented in an organized and user-friendly manner. A common and effective pattern for this is a tabbed interface, which allows users to navigate between different categories of information (e.g., Description, Specifications, Reviews) without overwhelming the initial view. This problem focuses on building a reusable React component that dynamically displays content using tabs.
Your primary task is to implement a Tabs React component that can display dynamic content based on an array of tab items provided as props.
Tabs Component: Implement a functional React component named Tabs.Tabs component should accept a prop named items, which is an array of TabItem objects. Each TabItem object will have an id (string), label (string), and content (React.ReactNode).label of each TabItem.Tabs component to keep track of which tab is currently active. The first tab in the items array should be active by default.content of the currently active tab in a designated content area.role="tablist", role="tab", aria-selected) for basic accessibility, especially for the tab headers.items prop are rendered.items array might be empty gracefully (e.g., no tabs or content rendered).Constraints
mockTabItems) is provided directly in App.tsx or passed as props. You do not need to make any API calls.react-router-dom).items data beyond basic checks.Loading editor...