@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.cjs.js
CHANGED
|
@@ -885,12 +885,22 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
885
885
|
var firstInstTotal = firstInstData.length > 0 ? firstInstValues.reduce(function (sum, val) {
|
|
886
886
|
return sum + val;
|
|
887
887
|
}, 0) : 510;
|
|
888
|
+
var totalRevData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) ? apiData.totalRevenue : [];
|
|
889
|
+
var totalRevValues = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
890
|
+
return item.value;
|
|
891
|
+
}) : currentData;
|
|
892
|
+
var totalRevCategories = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
893
|
+
return item.date;
|
|
894
|
+
}) : categories;
|
|
895
|
+
var totalRevTotal = totalRevData.length > 0 ? totalRevValues.reduce(function (sum, val) {
|
|
896
|
+
return sum + val;
|
|
897
|
+
}, 0) : 9200;
|
|
888
898
|
var primaryCharts = [{
|
|
889
899
|
label: "Total Revenue",
|
|
890
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue)
|
|
900
|
+
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === 'string' ? apiData.totalRevenue : "$9,200.00",
|
|
891
901
|
subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 215),
|
|
892
|
-
data:
|
|
893
|
-
categories:
|
|
902
|
+
data: totalRevValues,
|
|
903
|
+
categories: totalRevCategories,
|
|
894
904
|
showSelector: true
|
|
895
905
|
}, {
|
|
896
906
|
label: "First installments",
|