Interactive Breadcrumbs for Zomato Dish Pages
On Zomato, users often navigate through various categories and filters to find their desired restaurants or dishes. A clear and intuitive navigation trail is crucial for a smooth user experience. Breadcrumbs serve this purpose by showing the user's current location within the site hierarchy and providing easy access to parent pages. This problem challenges you to build a reusable Breadcrumbs component to enhance navigation on Zomato's dish detail pages.
Your task is to create a Breadcrumbs React component that displays a navigational path. The component should be dynamic, accepting an array of breadcrumb items as props.
Breadcrumbs.Breadcrumbs component should accept a prop, items, which is an array of objects. Each object will have a label (string) and a path (string).onNavigate callback function with its corresponding path as an argument. For this exercise, you can simulate navigation by logging the path to the console or using alert().> or /) between breadcrumb items.>).pointer) and ideally a subtle visual feedback on hover (e.g., text color change, underline).<nav> element with an appropriate aria-label.Breadcrumbs component correctly renders all items passed in the items prop.label is displayed correctly.onNavigate callback with the item's path.Constraints
console.log or alert().items prop will always be an array of BreadcrumbItem objects, and it will not be empty.aria-label for the navigation element.Breadcrumbs component is structured, its reusability, and props interface.onNavigate prop.Loading editor...