@ammarkhalidfarooq/dashboard-package 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +13 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +13 -3
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -883,12 +883,22 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
883
883
|
var firstInstTotal = firstInstData.length > 0 ? firstInstValues.reduce(function (sum, val) {
|
|
884
884
|
return sum + val;
|
|
885
885
|
}, 0) : 510;
|
|
886
|
+
var totalRevData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) ? apiData.totalRevenue : [];
|
|
887
|
+
var totalRevValues = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
888
|
+
return item.value;
|
|
889
|
+
}) : currentData;
|
|
890
|
+
var totalRevCategories = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
891
|
+
return item.date;
|
|
892
|
+
}) : categories;
|
|
893
|
+
var totalRevTotal = totalRevData.length > 0 ? totalRevValues.reduce(function (sum, val) {
|
|
894
|
+
return sum + val;
|
|
895
|
+
}, 0) : 9200;
|
|
886
896
|
var primaryCharts = [{
|
|
887
897
|
label: "Total Revenue",
|
|
888
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue)
|
|
898
|
+
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === 'string' ? apiData.totalRevenue : "$9,200.00",
|
|
889
899
|
subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 215),
|
|
890
|
-
data:
|
|
891
|
-
categories:
|
|
900
|
+
data: totalRevValues,
|
|
901
|
+
categories: totalRevCategories,
|
|
892
902
|
showSelector: true
|
|
893
903
|
}, {
|
|
894
904
|
label: "First installments",
|