Dynamic Dashboard Widget Skeleton
In high-performance applications like Browserstack's testing dashboards, perceived loading speed is as crucial as actual loading speed. Skeleton loaders provide an excellent user experience by giving users immediate visual feedback that content is on its way, reducing perceived wait times and improving engagement. This problem challenges you to implement a robust and reusable skeleton loader for a complex dashboard widget.
Your primary task is to create a versatile Skeleton React component and integrate it into a DashboardWidget to simulate a loading state.
Skeleton component:
variant (e.g., 'text', 'rect', 'circle'), width, and height.text variants, it should optionally support a count prop to render multiple lines of text, with varying widths for realism.Skeleton component into DashboardWidget:
isLoading is true, the DashboardWidget should display a skeleton representation that closely mimics the layout and proportions of the actual content.DashboardWidget (title, user avatars & names, metrics, chart area, action button) to appropriate Skeleton variants and sizes.fetchDashboardData promise resolves.#e2e8f0 or similar) for the skeleton background, with a lighter gradient for the shimmer effect.aria-busy="true" to the loading container to inform assistive technologies that content is being loaded.DashboardWidget component, which already has some basic responsive styling.Skeleton component is implemented as a functional React component.Skeleton component supports variant props (e.g., 'text', 'rect', 'circle').Skeleton component supports width and height props for custom sizing.text variant of the Skeleton component renders multiple lines with realistic, slightly varying widths when count is provided.DashboardWidget correctly displays the skeleton when isLoading is true.DashboardWidget's title, user list (avatars and names), metrics grid (labels and values), chart area, and action button.DashboardData content.Constraints
fetchDashboardData function simulates data loading; do not modify its behavior or delay.Skeleton component is designed for reusability and configurability.Loading editor...