@ammarkhalidfarooq/dashboard-package 0.3.19 → 0.3.21

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.es.js CHANGED
@@ -2298,7 +2298,7 @@ var NewOverview = function NewOverview(_ref) {
2298
2298
  return item.date;
2299
2299
  }) : categories;
2300
2300
  var primaryCharts = [{
2301
- label: "Total Revenue",
2301
+ label: "Total Raised",
2302
2302
  value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$9,200.00",
2303
2303
  subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 215),
2304
2304
  data: totalRevValues,
@@ -4796,7 +4796,7 @@ var OverallSection = function OverallSection(_ref) {
4796
4796
  "Total Raised": {
4797
4797
  value: "$".concat(formatNumber(apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedCard)) || "$240.9K",
4798
4798
  subValue: "".concat(Number((_apiData$totalRaisedP = apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedPrev) !== null && _apiData$totalRaisedP !== void 0 ? _apiData$totalRaisedP : 0).toFixed(2), "% vs ").concat(dateName || "last month"),
4799
- label: "Total Revenue",
4799
+ label: "Total Raised",
4800
4800
  icon: PaidOutlined
4801
4801
  },
4802
4802
  "Net Raised": {
@@ -4854,33 +4854,38 @@ var OverallSection = function OverallSection(_ref) {
4854
4854
  var mainChart = extendedCharts.find(function (c) {
4855
4855
  return c.label === selectedInfo.label;
4856
4856
  }) || primaryCharts[0];
4857
- if (activeMetric === "Total Raised" && (apiData !== null && apiData !== void 0 && apiData.paidAds || apiData !== null && apiData !== void 0 && apiData.email || apiData !== null && apiData !== void 0 && apiData.organic)) {
4858
- var categories = ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4859
- return item.date;
4860
- });
4861
- var series = [{
4862
- name: "Paid Ads",
4863
- data: ((apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || []).map(function (item) {
4864
- return item.value;
4865
- })
4866
- }, {
4867
- name: "Organic",
4868
- data: ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || []).map(function (item) {
4869
- return item.value;
4870
- })
4871
- }, {
4872
- name: "Email",
4873
- data: ((apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4874
- return item.value;
4875
- })
4876
- }];
4877
- mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4878
- label: "Total revenue trend",
4879
- series: series,
4880
- categories: categories,
4881
- stacked: true,
4882
- colors: ["#6366F1", "#10B981", "#06B6D4"]
4883
- });
4857
+ if (activeMetric === "Total Raised") {
4858
+ var hasStackedData = (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || (apiData === null || apiData === void 0 ? void 0 : apiData.organic);
4859
+ if (hasStackedData) {
4860
+ var categories = ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || (apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || (apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4861
+ return item.date;
4862
+ });
4863
+ var series = [{
4864
+ name: "Paid Ads",
4865
+ data: ((apiData === null || apiData === void 0 ? void 0 : apiData.paidAds) || []).map(function (item) {
4866
+ return item.value;
4867
+ })
4868
+ }, {
4869
+ name: "Organic",
4870
+ data: ((apiData === null || apiData === void 0 ? void 0 : apiData.organic) || []).map(function (item) {
4871
+ return item.value;
4872
+ })
4873
+ }, {
4874
+ name: "Email",
4875
+ data: ((apiData === null || apiData === void 0 ? void 0 : apiData.email) || []).map(function (item) {
4876
+ return item.value;
4877
+ })
4878
+ }];
4879
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4880
+ label: "Total revenue trend",
4881
+ data: undefined,
4882
+ // Clear single data property to force series usage
4883
+ series: series,
4884
+ categories: categories,
4885
+ stacked: true,
4886
+ colors: ["#6366F1", "#10B981", "#06B6D4"]
4887
+ });
4888
+ }
4884
4889
  }
4885
4890
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4886
4891
  label: mainChart.label || activeMetric,
@@ -4907,7 +4912,8 @@ var OverallSection = function OverallSection(_ref) {
4907
4912
  index: 0,
4908
4913
  md: 12,
4909
4914
  isPremium: true,
4910
- isPrimary: true
4915
+ isPrimary: true,
4916
+ metric: activeMetric.includes("Raised") || activeMetric.includes("donation") ? "Revenue" : "Donors"
4911
4917
  })
4912
4918
  }), /*#__PURE__*/jsxs(Grid, {
4913
4919
  container: true,