Dynamic Dashboard with Lazy-Loaded Tabs
PhonePe's merchant partners rely on intuitive dashboards to monitor their business performance. This problem focuses on building a crucial part of such a dashboard: a dynamic, tabbed interface that efficiently displays various types of widgets. The challenge lies in handling dynamic content configuration and implementing a lazy-loading strategy for tab content to optimize performance and user experience.
Your goal is to build a React application that renders a dynamic dashboard based on a given configuration. Specifically, you must:
DASHBOARD_CONFIG provided.MetricCard, TransactionList). You will need a mechanism to map widget types to their corresponding React components.MetricCard and TransactionList components should display their respective data in a readable format.DASHBOARD_CONFIG are displayed in the tab navigation.MetricCard widgets correctly display their title, value, label, and trend.TransactionList widgets correctly display their title and a list of transactions with description, amount, and date.fetchWidgetData) is properly integrated to simulate asynchronous content loading.Constraints
DASHBOARD_CONFIG is provided as a static JavaScript object and defines the structure of the dashboard.fetchWidgetData utility, which returns mock data asynchronously.useState, useEffect, useCallback).Chart widget types (only MetricCard and TransactionList are required).Loading editor...