import { Grid, Typography } from "@mui/material"; import { useTranslations } from "next-intl"; import RadialBarSemiCircularChart from "@/components/dashboard/reports/LoanDetails/RadialBarSemiCircularChart"; const FunctionalityCharts = ({ reportList }) => { const t = useTranslations(); const DataItemsName = [ { id: "expert", name: t("reports.expert") }, { id: "transportation_assistant", name: t("reports.transportation_assistant") }, { id: "province_manager", name: t("reports.province_manager") }, { id: "bank", name: t("reports.bank") }, ]; return ( {Object.entries(reportList).map(([entryKey, innerObject]) => { let percentage = innerObject.total !== 0 && innerObject.pending !== 64 ? ((innerObject.total - innerObject.pending) / innerObject.total) * 100 : 0; const ItemName = DataItemsName.find((item) => item.id === entryKey).name; return ( {ItemName} `${val}%`} label={t("reports.dynamic_label_functionality", { total: innerObject.total.toLocaleString("en"), done: (innerObject.total - innerObject.pending).toLocaleString("en"), })} /> ); })} ); }; export default FunctionalityCharts;