@ammarkhalidfarooq/dashboard-package 0.1.5 → 0.1.6

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 CHANGED
@@ -875,6 +875,16 @@ var NewOverview = function NewOverview(_ref) {
875
875
  var oneTimeTotal = oneTimeData.length > 0 ? oneTimeValues.reduce(function (sum, val) {
876
876
  return sum + val;
877
877
  }, 0) : 7100;
878
+ var firstInstData = (apiData === null || apiData === void 0 ? void 0 : apiData.firstInstallmentRevenue) || [];
879
+ var firstInstValues = firstInstData.length > 0 ? firstInstData.map(function (item) {
880
+ return item.value;
881
+ }) : currentData.slice(-7);
882
+ var firstInstCategories = firstInstData.length > 0 ? firstInstData.map(function (item) {
883
+ return item.date;
884
+ }) : categories.slice(-7);
885
+ var firstInstTotal = firstInstData.length > 0 ? firstInstValues.reduce(function (sum, val) {
886
+ return sum + val;
887
+ }, 0) : 510;
878
888
  var primaryCharts = [{
879
889
  label: "Total Revenue",
880
890
  value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) || "$9,200.00",
@@ -884,9 +894,9 @@ var NewOverview = function NewOverview(_ref) {
884
894
  showSelector: true
885
895
  }, {
886
896
  label: "First installments",
887
- value: "$510.00",
888
- data: currentData.slice(-7),
889
- categories: categories.slice(-7)
897
+ value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$510.00",
898
+ data: firstInstValues,
899
+ categories: firstInstCategories
890
900
  }, {
891
901
  label: "One-time donations",
892
902
  value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$7,100.00",