one-click-accessibility/modules/settings/assets/js/pages/assistant/stats/stats-counter.js
Nirbhay Singh ecfe3f4204
[APP-1857] Update chart components to mui (#388)
* update: change chart components to mui

* refactor: tooltip, chart data, rendering logic

* refactor: improved organization and reduce duplicated code

* update: colors with variables

* fix: width of the pie chart

* fix: pie chart width

* udpate: simply pie chart value calculation
2025-08-25 19:25:45 +05:30

28 lines
780 B
JavaScript

import Typography from '@elementor/ui/Typography';
import ValueLoader from '@ea11y/pages/assistant/loaders/value-loader';
import AccessibilityAssistantTooltip from '@ea11y/pages/assistant/tooltip';
import {
StyledStatsItem,
StyledStatsItemContent,
StyledStatsItemTitle,
} from './stats.styles';
const StatsCounter = ({ stat, loading, title, tooltip }) => {
return (
<StyledStatsItem className="scanned-urls">
<StyledStatsItemContent>
<StyledStatsItemTitle variant="subtitle1" as="p">
{title}
<AccessibilityAssistantTooltip content={tooltip} />
</StyledStatsItemTitle>
<Typography variant="h4" as="p">
{loading ? <ValueLoader /> : stat}
</Typography>
</StyledStatsItemContent>
</StyledStatsItem>
);
};
export default StatsCounter;