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