@ammarkhalidfarooq/dashboard-package 0.3.39 → 0.3.40

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
@@ -5519,6 +5519,10 @@ var OverallSection = function OverallSection(_ref) {
5519
5519
  }
5520
5520
  };
5521
5521
  var activeCampaignsData = (apiData === null || apiData === void 0 ? void 0 : apiData.activeCampaigns) || [];
5522
+ var donorMix = (apiData === null || apiData === void 0 ? void 0 : apiData.donorMix) || {};
5523
+ var totalDonorsMix = (donorMix.newDonors || 0) + (donorMix.returningDonors || 0);
5524
+ var newDonorsPerc = totalDonorsMix > 0 ? Math.round(donorMix.newDonors / totalDonorsMix * 100) : 0;
5525
+ var returningDonorsPerc = totalDonorsMix > 0 ? Math.round(donorMix.returningDonors / totalDonorsMix * 100) : 0;
5522
5526
  var renderCard = function renderCard(title) {
5523
5527
  return /*#__PURE__*/jsxRuntime.jsx(DisplayCard, {
5524
5528
  title: title,
@@ -5881,22 +5885,22 @@ var OverallSection = function OverallSection(_ref) {
5881
5885
  children: /*#__PURE__*/jsxRuntime.jsx(DonorMixCard, {
5882
5886
  title: "Donor mix",
5883
5887
  subtitle: "Acquisition vs retention",
5884
- series: [68, 32],
5888
+ series: [donorMix.newDonors || 0, donorMix.returningDonors || 0],
5885
5889
  labels: ["New donors", "Returning"],
5886
5890
  colors: ["rgb(99, 99, 230)", "#10B981"],
5887
5891
  centerLabel: "donors",
5888
- centerValue: "215",
5892
+ centerValue: totalDonorsMix.toString(),
5889
5893
  items: [{
5890
5894
  label: "New donors",
5891
- val: "146 · 68%",
5895
+ val: "".concat(donorMix.newDonors || 0, " \xB7 ").concat(newDonorsPerc, "%"),
5892
5896
  color: "rgb(99, 99, 230)"
5893
5897
  }, {
5894
5898
  label: "Returning",
5895
- val: "69 · 32%",
5899
+ val: "".concat(donorMix.returningDonors || 0, " \xB7 ").concat(returningDonorsPerc, "%"),
5896
5900
  color: "#10B981"
5897
5901
  }],
5898
- bottomSummaryValue: "$130.58",
5899
- bottomSummaryTrend: "8.4% vs last month",
5902
+ bottomSummaryValue: "$".concat(donorMix.avgGift || 0),
5903
+ bottomSummaryTrend: "".concat(donorMix.donorMixPrev || 0, "% vs ").concat(dateName || "last month"),
5900
5904
  sx: {
5901
5905
  width: "100%"
5902
5906
  }