@ammarkhalidfarooq/dashboard-package 0.3.25 → 0.3.27

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
@@ -555,7 +555,7 @@ var RenderChartCard = function RenderChartCard(_ref) {
555
555
  gap: 1,
556
556
  alignItems: "center"
557
557
  },
558
- children: item.hideControls ? /*#__PURE__*/jsx(Box, {
558
+ children: item.hideControls ? item.series && /*#__PURE__*/jsx(Box, {
559
559
  sx: {
560
560
  display: "flex",
561
561
  gap: 2,
@@ -4944,6 +4944,53 @@ var OverallSection = function OverallSection(_ref) {
4944
4944
  });
4945
4945
  }
4946
4946
  }
4947
+ if (activeMetric === "Net Raised") {
4948
+ var netData = apiData === null || apiData === void 0 ? void 0 : apiData.netRaised;
4949
+ var _hasStackedData = (netData === null || netData === void 0 ? void 0 : netData.paidAds) || (netData === null || netData === void 0 ? void 0 : netData.email) || (netData === null || netData === void 0 ? void 0 : netData.organic);
4950
+ if (_hasStackedData) {
4951
+ var _categories = ((netData === null || netData === void 0 ? void 0 : netData.organic) || (netData === null || netData === void 0 ? void 0 : netData.paidAds) || (netData === null || netData === void 0 ? void 0 : netData.email) || []).map(function (item) {
4952
+ return item.date;
4953
+ });
4954
+ var _series = [{
4955
+ name: "Paid Ads",
4956
+ data: ((netData === null || netData === void 0 ? void 0 : netData.paidAds) || []).map(function (item) {
4957
+ return item.value;
4958
+ })
4959
+ }, {
4960
+ name: "Organic",
4961
+ data: ((netData === null || netData === void 0 ? void 0 : netData.organic) || []).map(function (item) {
4962
+ return item.value;
4963
+ })
4964
+ }, {
4965
+ name: "Email",
4966
+ data: ((netData === null || netData === void 0 ? void 0 : netData.email) || []).map(function (item) {
4967
+ return item.value;
4968
+ })
4969
+ }];
4970
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4971
+ label: "Net revenue trend",
4972
+ data: undefined,
4973
+ series: _series,
4974
+ categories: _categories,
4975
+ stacked: true,
4976
+ colors: ["#6366F1", "#10B981", "#06B6D4"],
4977
+ hideControls: true
4978
+ });
4979
+ } else if (Array.isArray(netData) && netData.length > 0) {
4980
+ mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4981
+ label: "Net revenue trend",
4982
+ data: netData.map(function (item) {
4983
+ return item.value;
4984
+ }),
4985
+ categories: netData.map(function (item) {
4986
+ return item.date;
4987
+ }),
4988
+ series: undefined,
4989
+ stacked: false,
4990
+ hideControls: true
4991
+ });
4992
+ }
4993
+ }
4947
4994
  mainChart = _objectSpread2(_objectSpread2({}, mainChart), {}, {
4948
4995
  label: mainChart.label || activeMetric,
4949
4996
  value: selectedInfo.value,