@ammarkhalidfarooq/dashboard-package 0.6.112 → 0.6.113
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 +163 -239
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +163 -239
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -3870,9 +3870,9 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3870
3870
|
activeFilters = _ref$activeFilters === void 0 ? [] : _ref$activeFilters,
|
|
3871
3871
|
setExportLoading = _ref.setExportLoading;
|
|
3872
3872
|
var initialMetric = "Revenue";
|
|
3873
|
-
var revenueData = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [
|
|
3874
|
-
var donationsData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationsData) || [
|
|
3875
|
-
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [
|
|
3873
|
+
var revenueData = (apiData === null || apiData === void 0 ? void 0 : apiData.revenueData) || [0];
|
|
3874
|
+
var donationsData = (apiData === null || apiData === void 0 ? void 0 : apiData.donationsData) || [0];
|
|
3875
|
+
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [];
|
|
3876
3876
|
var _useState = useState(initialMetric),
|
|
3877
3877
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3878
3878
|
metric = _useState2[0];
|
|
@@ -3988,7 +3988,7 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3988
3988
|
}) : categories;
|
|
3989
3989
|
var oneTimeTotal = oneTimeData.length > 0 ? oneTimeValues.reduce(function (sum, val) {
|
|
3990
3990
|
return sum + val;
|
|
3991
|
-
}, 0) :
|
|
3991
|
+
}, 0) : 0;
|
|
3992
3992
|
var firstInstData = (apiData === null || apiData === void 0 ? void 0 : apiData.firstInstallmentRevenue) || [];
|
|
3993
3993
|
var firstInstValues = firstInstData.length > 0 ? firstInstData.map(function (item) {
|
|
3994
3994
|
return item.value;
|
|
@@ -3998,7 +3998,7 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
3998
3998
|
}) : categories.slice(-7);
|
|
3999
3999
|
var firstInstTotal = firstInstData.length > 0 ? firstInstValues.reduce(function (sum, val) {
|
|
4000
4000
|
return sum + val;
|
|
4001
|
-
}, 0) :
|
|
4001
|
+
}, 0) : 0;
|
|
4002
4002
|
var totalRevData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) ? apiData.totalRevenue : [];
|
|
4003
4003
|
var totalRevValues = totalRevData.length > 0 ? totalRevData.map(function (item) {
|
|
4004
4004
|
return item.value;
|
|
@@ -4008,67 +4008,67 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4008
4008
|
}) : categories;
|
|
4009
4009
|
var totalRevTotal = totalRevData.length > 0 ? totalRevValues.reduce(function (sum, val) {
|
|
4010
4010
|
return sum + val;
|
|
4011
|
-
}, 0) :
|
|
4011
|
+
}, 0) : 0;
|
|
4012
4012
|
var avgDonData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.averageDonation) ? apiData.averageDonation : [];
|
|
4013
4013
|
var avgDonValues = avgDonData.length > 0 ? avgDonData.map(function (item) {
|
|
4014
4014
|
return item.value;
|
|
4015
|
-
}) : currentData.map(function (
|
|
4016
|
-
return
|
|
4015
|
+
}) : currentData.map(function () {
|
|
4016
|
+
return 0;
|
|
4017
4017
|
});
|
|
4018
4018
|
var avgDonCategories = avgDonData.length > 0 ? avgDonData.map(function (item) {
|
|
4019
4019
|
return item.date;
|
|
4020
4020
|
}) : categories;
|
|
4021
4021
|
var avgDonOverall = avgDonData.length > 0 ? avgDonValues.reduce(function (sum, val) {
|
|
4022
4022
|
return sum + val;
|
|
4023
|
-
}, 0) / avgDonValues.length :
|
|
4023
|
+
}, 0) / avgDonValues.length : 0;
|
|
4024
4024
|
var tipData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.tipAmount) ? apiData.tipAmount : [];
|
|
4025
4025
|
var tipValues = tipData.length > 0 ? tipData.map(function (item) {
|
|
4026
4026
|
return item.value;
|
|
4027
|
-
}) : currentData.map(function (
|
|
4028
|
-
return
|
|
4027
|
+
}) : currentData.map(function () {
|
|
4028
|
+
return 0;
|
|
4029
4029
|
});
|
|
4030
4030
|
var tipCategories = tipData.length > 0 ? tipData.map(function (item) {
|
|
4031
4031
|
return item.date;
|
|
4032
4032
|
}) : categories;
|
|
4033
4033
|
var tipTotal = tipData.length > 0 ? tipValues.reduce(function (sum, val) {
|
|
4034
4034
|
return sum + val;
|
|
4035
|
-
}, 0) :
|
|
4035
|
+
}, 0) : 0;
|
|
4036
4036
|
var convRateData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.conversionRate) ? apiData.conversionRate : [];
|
|
4037
4037
|
var convRateValues = convRateData.length > 0 ? convRateData.map(function (item) {
|
|
4038
4038
|
return item.value;
|
|
4039
|
-
}) : [
|
|
4039
|
+
}) : [0];
|
|
4040
4040
|
var convRateCategories = convRateData.length > 0 ? convRateData.map(function (item) {
|
|
4041
4041
|
return item.date;
|
|
4042
4042
|
}) : categories;
|
|
4043
4043
|
var convRateAvg = convRateData.length > 0 ? convRateValues.reduce(function (sum, val) {
|
|
4044
4044
|
return sum + val;
|
|
4045
|
-
}, 0) / convRateValues.length :
|
|
4045
|
+
}, 0) / convRateValues.length : 0;
|
|
4046
4046
|
var organicVisData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.organicVisits) ? apiData.organicVisits : [];
|
|
4047
4047
|
var paidVisData = Array.isArray(apiData === null || apiData === void 0 ? void 0 : apiData.paidVisits) ? apiData.paidVisits : [];
|
|
4048
4048
|
var organicVisValues = organicVisData.length > 0 ? organicVisData.map(function (item) {
|
|
4049
4049
|
return item.value;
|
|
4050
|
-
}) : [
|
|
4050
|
+
}) : [0];
|
|
4051
4051
|
var paidVisValues = paidVisData.length > 0 ? paidVisData.map(function (item) {
|
|
4052
4052
|
return item.value;
|
|
4053
|
-
}) : [
|
|
4053
|
+
}) : [0];
|
|
4054
4054
|
var trafficCategories = organicVisData.length > 0 ? organicVisData.map(function (item) {
|
|
4055
4055
|
return item.date;
|
|
4056
4056
|
}) : categories;
|
|
4057
4057
|
var primaryCharts = [{
|
|
4058
4058
|
label: "Total Raised",
|
|
4059
|
-
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$
|
|
4059
|
+
value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$0.00",
|
|
4060
4060
|
subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 0),
|
|
4061
4061
|
data: totalRevValues,
|
|
4062
4062
|
categories: totalRevCategories,
|
|
4063
4063
|
showSelector: true
|
|
4064
4064
|
}, {
|
|
4065
4065
|
label: "First installments",
|
|
4066
|
-
value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$
|
|
4066
|
+
value: apiData !== null && apiData !== void 0 && apiData.firstInstallmentRevenue ? "$".concat(firstInstTotal.toLocaleString()) : "$0.00",
|
|
4067
4067
|
data: firstInstValues,
|
|
4068
4068
|
categories: firstInstCategories
|
|
4069
4069
|
}, {
|
|
4070
4070
|
label: "One-time donations",
|
|
4071
|
-
value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$
|
|
4071
|
+
value: apiData !== null && apiData !== void 0 && apiData.oneTimeDonations ? "$".concat(oneTimeTotal.toLocaleString()) : "$0.00",
|
|
4072
4072
|
data: oneTimeValues,
|
|
4073
4073
|
categories: oneTimeCategories
|
|
4074
4074
|
}];
|
|
@@ -4076,32 +4076,36 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4076
4076
|
label: "New vs Returning Donors",
|
|
4077
4077
|
series: [{
|
|
4078
4078
|
name: "New Donors",
|
|
4079
|
-
data:
|
|
4079
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4080
|
+
return 0;
|
|
4081
|
+
}) : [0]
|
|
4080
4082
|
}, {
|
|
4081
4083
|
name: "Returning",
|
|
4082
|
-
data:
|
|
4084
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4085
|
+
return 0;
|
|
4086
|
+
}) : [0]
|
|
4083
4087
|
}],
|
|
4084
4088
|
categories: categories,
|
|
4085
4089
|
stacked: true,
|
|
4086
4090
|
footer: {
|
|
4087
|
-
left: "New donors:
|
|
4088
|
-
right: "Returning donors:
|
|
4091
|
+
left: "New donors: 0",
|
|
4092
|
+
right: "Returning donors: 0"
|
|
4089
4093
|
}
|
|
4090
4094
|
}, {
|
|
4091
4095
|
label: "Average Donation Amount",
|
|
4092
|
-
value: apiData !== null && apiData !== void 0 && apiData.averageDonation ? "$".concat(avgDonOverall.toFixed(2)) : "$
|
|
4096
|
+
value: apiData !== null && apiData !== void 0 && apiData.averageDonation ? "$".concat(avgDonOverall.toFixed(2)) : "$0.00",
|
|
4093
4097
|
data: avgDonValues,
|
|
4094
4098
|
categories: avgDonCategories
|
|
4095
4099
|
}, {
|
|
4096
4100
|
label: "Tip Amount",
|
|
4097
|
-
value: apiData !== null && apiData !== void 0 && apiData.tipAmount ? "$".concat(tipTotal.toLocaleString()) : "$
|
|
4098
|
-
subValue: "Number of Tips: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalTips) ||
|
|
4101
|
+
value: apiData !== null && apiData !== void 0 && apiData.tipAmount ? "$".concat(tipTotal.toLocaleString()) : "$0.00",
|
|
4102
|
+
subValue: "Number of Tips: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalTips) || 0),
|
|
4099
4103
|
data: tipValues,
|
|
4100
4104
|
categories: tipCategories
|
|
4101
4105
|
}];
|
|
4102
4106
|
var tertiaryCharts = [{
|
|
4103
4107
|
label: "Conversion Rate",
|
|
4104
|
-
value: apiData !== null && apiData !== void 0 && apiData.conversionRate ? "".concat(convRateAvg.toFixed(1), "%") : "
|
|
4108
|
+
value: apiData !== null && apiData !== void 0 && apiData.conversionRate ? "".concat(convRateAvg.toFixed(1), "%") : "0%",
|
|
4105
4109
|
data: convRateValues,
|
|
4106
4110
|
categories: convRateCategories
|
|
4107
4111
|
}, {
|
|
@@ -4117,24 +4121,32 @@ var NewOverview = function NewOverview(_ref) {
|
|
|
4117
4121
|
stacked: true
|
|
4118
4122
|
}, {
|
|
4119
4123
|
label: "Organic Donations",
|
|
4120
|
-
value: "
|
|
4121
|
-
data:
|
|
4124
|
+
value: "0",
|
|
4125
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4126
|
+
return 0;
|
|
4127
|
+
}) : [0],
|
|
4122
4128
|
categories: categories
|
|
4123
4129
|
}];
|
|
4124
4130
|
var quaternaryCharts = [{
|
|
4125
4131
|
label: "Email Marketing",
|
|
4126
|
-
value: "
|
|
4127
|
-
data:
|
|
4132
|
+
value: "0",
|
|
4133
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4134
|
+
return 0;
|
|
4135
|
+
}) : [0],
|
|
4128
4136
|
categories: categories
|
|
4129
4137
|
}, {
|
|
4130
4138
|
label: "Traffic source",
|
|
4131
|
-
value: "
|
|
4132
|
-
data:
|
|
4139
|
+
value: "0%",
|
|
4140
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4141
|
+
return 0;
|
|
4142
|
+
}) : [0],
|
|
4133
4143
|
categories: categories
|
|
4134
4144
|
}, {
|
|
4135
4145
|
label: "URL",
|
|
4136
|
-
value: "
|
|
4137
|
-
data:
|
|
4146
|
+
value: "0%",
|
|
4147
|
+
data: categories.length > 0 ? categories.map(function () {
|
|
4148
|
+
return 0;
|
|
4149
|
+
}) : [0],
|
|
4138
4150
|
categories: categories
|
|
4139
4151
|
}];
|
|
4140
4152
|
return /*#__PURE__*/jsxs(Box, {
|
|
@@ -17997,34 +18009,38 @@ var OverallSection = function OverallSection(_ref) {
|
|
|
17997
18009
|
var getExtendedCharts = function getExtendedCharts() {
|
|
17998
18010
|
var charts = _toConsumableArray(allCharts);
|
|
17999
18011
|
var categories = (apiData === null || apiData === void 0 ? void 0 : apiData.categories) || [];
|
|
18012
|
+
var zeroData = categories.length > 0 ? categories.map(function () {
|
|
18013
|
+
return 0;
|
|
18014
|
+
}) : [0];
|
|
18000
18015
|
if (!charts.find(function (c) {
|
|
18001
18016
|
return c.label === "Net Raised";
|
|
18002
18017
|
})) {
|
|
18018
|
+
var _apiData$netRaised;
|
|
18003
18019
|
charts.push({
|
|
18004
18020
|
label: "Net Raised",
|
|
18005
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaised)
|
|
18006
|
-
data:
|
|
18007
|
-
return v * 0.92;
|
|
18008
|
-
}),
|
|
18021
|
+
value: (_apiData$netRaised = apiData === null || apiData === void 0 ? void 0 : apiData.netRaised) !== null && _apiData$netRaised !== void 0 ? _apiData$netRaised : "$0",
|
|
18022
|
+
data: zeroData,
|
|
18009
18023
|
categories: categories
|
|
18010
18024
|
});
|
|
18011
18025
|
}
|
|
18012
18026
|
if (!charts.find(function (c) {
|
|
18013
18027
|
return c.label === "Total Donors";
|
|
18014
18028
|
})) {
|
|
18029
|
+
var _apiData$totalDonors;
|
|
18015
18030
|
charts.push({
|
|
18016
18031
|
label: "Total Donors",
|
|
18017
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors)
|
|
18018
|
-
data:
|
|
18032
|
+
value: (_apiData$totalDonors = apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors) !== null && _apiData$totalDonors !== void 0 ? _apiData$totalDonors : "0",
|
|
18033
|
+
data: zeroData,
|
|
18019
18034
|
categories: categories
|
|
18020
18035
|
});
|
|
18021
18036
|
}
|
|
18022
18037
|
if (!charts.find(function (c) {
|
|
18023
18038
|
return c.label === "ROAS";
|
|
18024
18039
|
})) {
|
|
18040
|
+
var _apiData$roas;
|
|
18025
18041
|
charts.push({
|
|
18026
18042
|
label: "ROAS",
|
|
18027
|
-
value: (apiData === null || apiData === void 0 ? void 0 : apiData.roas)
|
|
18043
|
+
value: (_apiData$roas = apiData === null || apiData === void 0 ? void 0 : apiData.roas) !== null && _apiData$roas !== void 0 ? _apiData$roas : "0.0x",
|
|
18028
18044
|
data: [],
|
|
18029
18045
|
categories: categories
|
|
18030
18046
|
});
|
|
@@ -18634,9 +18650,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18634
18650
|
if (!hasPaidOverview) {
|
|
18635
18651
|
return {
|
|
18636
18652
|
"Total Spent": {
|
|
18637
|
-
value: "$".concat(formatNumber(
|
|
18638
|
-
subValue:
|
|
18639
|
-
data:
|
|
18653
|
+
value: "$".concat(formatNumber(0)),
|
|
18654
|
+
subValue: formatGrowth$2(0),
|
|
18655
|
+
data: flatSeries(0),
|
|
18640
18656
|
categories: fallbackCategories,
|
|
18641
18657
|
icon: /*#__PURE__*/jsx(IndeterminateCheckBoxOutlined, {}),
|
|
18642
18658
|
money: true,
|
|
@@ -18644,9 +18660,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18644
18660
|
warning: false
|
|
18645
18661
|
},
|
|
18646
18662
|
"Revinue Raised": {
|
|
18647
|
-
value: "$".concat(formatNumber(
|
|
18648
|
-
subValue:
|
|
18649
|
-
data:
|
|
18663
|
+
value: "$".concat(formatNumber(0)),
|
|
18664
|
+
subValue: formatGrowth$2(0),
|
|
18665
|
+
data: flatSeries(0),
|
|
18650
18666
|
categories: fallbackCategories,
|
|
18651
18667
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
18652
18668
|
money: true,
|
|
@@ -18654,9 +18670,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18654
18670
|
warning: false
|
|
18655
18671
|
},
|
|
18656
18672
|
ROAS: {
|
|
18657
|
-
value: "
|
|
18658
|
-
subValue:
|
|
18659
|
-
data:
|
|
18673
|
+
value: "0.0x",
|
|
18674
|
+
subValue: formatGrowth$2(0),
|
|
18675
|
+
data: flatSeries(0),
|
|
18660
18676
|
categories: fallbackCategories,
|
|
18661
18677
|
icon: /*#__PURE__*/jsx(TrendingUp, {}),
|
|
18662
18678
|
money: false,
|
|
@@ -18664,9 +18680,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18664
18680
|
warning: false
|
|
18665
18681
|
},
|
|
18666
18682
|
"Cost Per Donor": {
|
|
18667
|
-
value: "$".concat(formatNumber(
|
|
18668
|
-
subValue:
|
|
18669
|
-
data:
|
|
18683
|
+
value: "$".concat(formatNumber(0)),
|
|
18684
|
+
subValue: formatGrowth$2(0),
|
|
18685
|
+
data: flatSeries(0),
|
|
18670
18686
|
categories: fallbackCategories,
|
|
18671
18687
|
icon: /*#__PURE__*/jsx(PersonOutlined, {}),
|
|
18672
18688
|
money: true,
|
|
@@ -18674,9 +18690,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18674
18690
|
warning: false
|
|
18675
18691
|
},
|
|
18676
18692
|
"Conversion Rate": {
|
|
18677
|
-
value: "
|
|
18678
|
-
subValue:
|
|
18679
|
-
data:
|
|
18693
|
+
value: "0.00%",
|
|
18694
|
+
subValue: formatGrowth$2(0),
|
|
18695
|
+
data: flatSeries(0),
|
|
18680
18696
|
categories: fallbackCategories,
|
|
18681
18697
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
18682
18698
|
money: false,
|
|
@@ -18684,9 +18700,9 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18684
18700
|
warning: false
|
|
18685
18701
|
},
|
|
18686
18702
|
"Avg Donation": {
|
|
18687
|
-
value: "$".concat(formatNumber(
|
|
18688
|
-
subValue:
|
|
18689
|
-
data:
|
|
18703
|
+
value: "$".concat(formatNumber(0)),
|
|
18704
|
+
subValue: formatGrowth$2(0),
|
|
18705
|
+
data: flatSeries(0),
|
|
18690
18706
|
categories: fallbackCategories,
|
|
18691
18707
|
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
18692
18708
|
money: true,
|
|
@@ -18761,7 +18777,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18761
18777
|
}, [fallbackCategories, growth, hasPaidOverview, overview, revenueSeries, roasChartData, spendSeries]);
|
|
18762
18778
|
var channelRows = useMemo(function () {
|
|
18763
18779
|
var channels = apiData === null || apiData === void 0 ? void 0 : apiData.channelPerformance;
|
|
18764
|
-
if (!hasPaidOverview) return
|
|
18780
|
+
if (!hasPaidOverview) return [];
|
|
18765
18781
|
if (!Array.isArray(channels) || channels.length === 0) return [];
|
|
18766
18782
|
return channels.map(function (item) {
|
|
18767
18783
|
var _item$roas, _item$spend, _item$revenue, _item$cpa;
|
|
@@ -18783,7 +18799,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18783
18799
|
var spendAllocation = useMemo(function () {
|
|
18784
18800
|
var _allocation$totalSpen, _allocation$totalSpen2;
|
|
18785
18801
|
var allocation = apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation;
|
|
18786
|
-
if (!hasPaidOverview) return
|
|
18802
|
+
if (!hasPaidOverview) return [];
|
|
18787
18803
|
if (!allocation || !Array.isArray(allocation.data) || allocation.data.length === 0) {
|
|
18788
18804
|
return buildEmptySpendAllocation();
|
|
18789
18805
|
}
|
|
@@ -18825,7 +18841,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18825
18841
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.spendAllocation, hasPaidOverview]);
|
|
18826
18842
|
var topCampaignsData = useMemo(function () {
|
|
18827
18843
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaigns;
|
|
18828
|
-
if (!hasPaidOverview) return
|
|
18844
|
+
if (!hasPaidOverview) return [];
|
|
18829
18845
|
if (!Array.isArray(campaigns)) return [];
|
|
18830
18846
|
if (campaigns.length === 0) return [];
|
|
18831
18847
|
return campaigns.map(function (item) {
|
|
@@ -18859,8 +18875,11 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18859
18875
|
},
|
|
18860
18876
|
sx: metricInfo[title].error ? {
|
|
18861
18877
|
border: "2px solid #ef4444",
|
|
18862
|
-
bgcolor: "#fffafa"
|
|
18863
|
-
|
|
18878
|
+
bgcolor: "#fffafa",
|
|
18879
|
+
cursor: "pointer"
|
|
18880
|
+
} : {
|
|
18881
|
+
cursor: "pointer"
|
|
18882
|
+
}
|
|
18864
18883
|
});
|
|
18865
18884
|
};
|
|
18866
18885
|
var selectedInfo = metricInfo[activeMetric] || metricInfo["Total Spent"];
|
|
@@ -18928,72 +18947,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
18928
18947
|
columns: ["Channel", "Ppend", "Revenue", "ROAS", "CPA", "Trend"],
|
|
18929
18948
|
gridTemplateColumns: "2.2fr 1fr 1fr 0.8fr 0.8fr 1.2fr",
|
|
18930
18949
|
height: "100%",
|
|
18931
|
-
rows: channelRows !== null && channelRows !== void 0 ? channelRows :
|
|
18932
|
-
id: "M",
|
|
18933
|
-
avatarBg: "#4267B2",
|
|
18934
|
-
name: "Meta Ads",
|
|
18935
|
-
val1: "$32,800",
|
|
18936
|
-
val2: "$112,400",
|
|
18937
|
-
val3: "3.4x",
|
|
18938
|
-
val4: "$340",
|
|
18939
|
-
type: "trend",
|
|
18940
|
-
trendType: "up",
|
|
18941
|
-
trendLabel: "Improving",
|
|
18942
|
-
highlightVal3: true,
|
|
18943
|
-
val3Color: "#22C55E"
|
|
18944
|
-
}, {
|
|
18945
|
-
id: "G",
|
|
18946
|
-
avatarBg: "#4285F4",
|
|
18947
|
-
name: "Google Ads",
|
|
18948
|
-
val1: "$28,200",
|
|
18949
|
-
val2: "$78,300",
|
|
18950
|
-
val3: "2.8x",
|
|
18951
|
-
val4: "$385",
|
|
18952
|
-
type: "trend",
|
|
18953
|
-
trendType: "up",
|
|
18954
|
-
trendLabel: "Improving",
|
|
18955
|
-
highlightVal3: true,
|
|
18956
|
-
val3Color: "#22C55E"
|
|
18957
|
-
}, {
|
|
18958
|
-
id: "T",
|
|
18959
|
-
avatarBg: "#000000",
|
|
18960
|
-
name: "TikTok Ads",
|
|
18961
|
-
val1: "$11,400",
|
|
18962
|
-
val2: "$31,200",
|
|
18963
|
-
val3: "2.7x",
|
|
18964
|
-
val4: "$402",
|
|
18965
|
-
type: "trend",
|
|
18966
|
-
trendType: "up",
|
|
18967
|
-
trendLabel: "Improving",
|
|
18968
|
-
highlightVal3: true,
|
|
18969
|
-
val3Color: "#22C55E"
|
|
18970
|
-
}, {
|
|
18971
|
-
id: "Y",
|
|
18972
|
-
avatarBg: "#FF0000",
|
|
18973
|
-
name: "YouTube",
|
|
18974
|
-
val1: "$5,313",
|
|
18975
|
-
val2: "$12,600",
|
|
18976
|
-
val3: "2.4x",
|
|
18977
|
-
val4: "$443",
|
|
18978
|
-
type: "trend",
|
|
18979
|
-
trendType: "down",
|
|
18980
|
-
trendLabel: "Declining",
|
|
18981
|
-
highlightVal3: true,
|
|
18982
|
-
val3Color: "#EF4444"
|
|
18983
|
-
}, {
|
|
18984
|
-
id: "S",
|
|
18985
|
-
avatarBg: "#FFFC00",
|
|
18986
|
-
name: "Snapchat",
|
|
18987
|
-
val1: "$2,600",
|
|
18988
|
-
val2: "$6,438",
|
|
18989
|
-
val3: "2.5x",
|
|
18990
|
-
val4: "$418",
|
|
18991
|
-
type: "trend",
|
|
18992
|
-
trendType: "up",
|
|
18993
|
-
trendLabel: "Improving",
|
|
18994
|
-
highlightVal3: true,
|
|
18995
|
-
val3Color: "#22C55E"
|
|
18996
|
-
}]
|
|
18950
|
+
rows: channelRows !== null && channelRows !== void 0 ? channelRows : []
|
|
18997
18951
|
})
|
|
18998
18952
|
}), /*#__PURE__*/jsx(Grid, {
|
|
18999
18953
|
item: true,
|
|
@@ -19013,33 +18967,13 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
19013
18967
|
},
|
|
19014
18968
|
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
19015
18969
|
title: "Spend Allocation",
|
|
19016
|
-
subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt :
|
|
19017
|
-
series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri :
|
|
19018
|
-
labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe :
|
|
19019
|
-
colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo :
|
|
18970
|
+
subtitle: (_spendAllocation$subt = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.subtitle) !== null && _spendAllocation$subt !== void 0 ? _spendAllocation$subt : emptySpendAllocation.subtitle,
|
|
18971
|
+
series: (_spendAllocation$seri = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.series) !== null && _spendAllocation$seri !== void 0 ? _spendAllocation$seri : emptySpendAllocation.series,
|
|
18972
|
+
labels: (_spendAllocation$labe = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.labels) !== null && _spendAllocation$labe !== void 0 ? _spendAllocation$labe : emptySpendAllocation.labels,
|
|
18973
|
+
colors: (_spendAllocation$colo = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.colors) !== null && _spendAllocation$colo !== void 0 ? _spendAllocation$colo : emptySpendAllocation.colors,
|
|
19020
18974
|
centerLabel: (_spendAllocation$cent = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerLabel) !== null && _spendAllocation$cent !== void 0 ? _spendAllocation$cent : "total spend",
|
|
19021
|
-
centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 :
|
|
19022
|
-
items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item :
|
|
19023
|
-
label: "Meta Ads",
|
|
19024
|
-
val: "40.8%",
|
|
19025
|
-
color: "#4267B2"
|
|
19026
|
-
}, {
|
|
19027
|
-
label: "Google Ads",
|
|
19028
|
-
val: "35.1%",
|
|
19029
|
-
color: "#4285F4"
|
|
19030
|
-
}, {
|
|
19031
|
-
label: "TikTok",
|
|
19032
|
-
val: "14.2%",
|
|
19033
|
-
color: "#cd249dff"
|
|
19034
|
-
}, {
|
|
19035
|
-
label: "YouTube",
|
|
19036
|
-
val: "6.6%",
|
|
19037
|
-
color: "#FF0000"
|
|
19038
|
-
}, {
|
|
19039
|
-
label: "Snapchat",
|
|
19040
|
-
val: "3.3%",
|
|
19041
|
-
color: "#FFFC00"
|
|
19042
|
-
}],
|
|
18975
|
+
centerValue: (_spendAllocation$cent2 = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.centerValue) !== null && _spendAllocation$cent2 !== void 0 ? _spendAllocation$cent2 : emptySpendAllocation.centerValue,
|
|
18976
|
+
items: (_spendAllocation$item = spendAllocation === null || spendAllocation === void 0 ? void 0 : spendAllocation.items) !== null && _spendAllocation$item !== void 0 ? _spendAllocation$item : emptySpendAllocation.items,
|
|
19043
18977
|
showBottomSummary: false,
|
|
19044
18978
|
sx: {
|
|
19045
18979
|
pb: 3.5,
|
|
@@ -19067,7 +19001,7 @@ var PaidSection = function PaidSection(_ref) {
|
|
|
19067
19001
|
width: "100%"
|
|
19068
19002
|
},
|
|
19069
19003
|
children: /*#__PURE__*/jsx(TopPerformingCampaignsCard, {
|
|
19070
|
-
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData :
|
|
19004
|
+
data: topCampaignsData !== null && topCampaignsData !== void 0 ? topCampaignsData : []
|
|
19071
19005
|
})
|
|
19072
19006
|
})
|
|
19073
19007
|
}), /*#__PURE__*/jsx(Grid, {
|
|
@@ -19142,6 +19076,12 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19142
19076
|
var revenueSeries = mapTimeSeries$1(apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue);
|
|
19143
19077
|
var avgDonationSeries = mapTimeSeries$1(apiData === null || apiData === void 0 ? void 0 : apiData.avgDonations);
|
|
19144
19078
|
var fallbackCategories = organicUsersSeries.categories.length ? organicUsersSeries.categories : ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
|
|
19079
|
+
var flatZeroData = function flatZeroData() {
|
|
19080
|
+
var categories = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : fallbackCategories;
|
|
19081
|
+
return categories.length > 0 ? categories.map(function () {
|
|
19082
|
+
return 0;
|
|
19083
|
+
}) : [0];
|
|
19084
|
+
};
|
|
19145
19085
|
var growthCaption = function growthCaption(key) {
|
|
19146
19086
|
return formatGrowth$1(growth[key]);
|
|
19147
19087
|
};
|
|
@@ -19150,9 +19090,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19150
19090
|
if (!hasOrganicOverview) {
|
|
19151
19091
|
return {
|
|
19152
19092
|
"Organic Users": {
|
|
19153
|
-
value:
|
|
19154
|
-
subValue:
|
|
19155
|
-
data:
|
|
19093
|
+
value: formatNumber(0),
|
|
19094
|
+
subValue: formatGrowth$1(0),
|
|
19095
|
+
data: flatZeroData(),
|
|
19156
19096
|
categories: fallbackCategories,
|
|
19157
19097
|
icon: /*#__PURE__*/jsx(PeopleAltOutlined, {}),
|
|
19158
19098
|
money: false,
|
|
@@ -19160,9 +19100,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19160
19100
|
error: false
|
|
19161
19101
|
},
|
|
19162
19102
|
"Search Clicks": {
|
|
19163
|
-
value:
|
|
19164
|
-
subValue:
|
|
19165
|
-
data:
|
|
19103
|
+
value: formatNumber(0),
|
|
19104
|
+
subValue: formatGrowth$1(0),
|
|
19105
|
+
data: flatZeroData(),
|
|
19166
19106
|
categories: fallbackCategories,
|
|
19167
19107
|
icon: /*#__PURE__*/jsx(SearchOutlined, {}),
|
|
19168
19108
|
money: false,
|
|
@@ -19170,9 +19110,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19170
19110
|
error: false
|
|
19171
19111
|
},
|
|
19172
19112
|
Donations: {
|
|
19173
|
-
value:
|
|
19174
|
-
subValue:
|
|
19175
|
-
data:
|
|
19113
|
+
value: formatNumber(0),
|
|
19114
|
+
subValue: formatGrowth$1(0),
|
|
19115
|
+
data: flatZeroData(),
|
|
19176
19116
|
categories: fallbackCategories,
|
|
19177
19117
|
icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
|
|
19178
19118
|
money: false,
|
|
@@ -19180,9 +19120,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19180
19120
|
error: false
|
|
19181
19121
|
},
|
|
19182
19122
|
"Conversion Rate": {
|
|
19183
|
-
value: "
|
|
19184
|
-
subValue:
|
|
19185
|
-
data:
|
|
19123
|
+
value: "0.00%",
|
|
19124
|
+
subValue: formatGrowth$1(0),
|
|
19125
|
+
data: flatZeroData(),
|
|
19186
19126
|
categories: fallbackCategories,
|
|
19187
19127
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
19188
19128
|
money: false,
|
|
@@ -19190,9 +19130,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19190
19130
|
error: false
|
|
19191
19131
|
},
|
|
19192
19132
|
"Revenue Raised": {
|
|
19193
|
-
value: "$".concat(formatNumber(
|
|
19194
|
-
subValue:
|
|
19195
|
-
data:
|
|
19133
|
+
value: "$".concat(formatNumber(0)),
|
|
19134
|
+
subValue: formatGrowth$1(0),
|
|
19135
|
+
data: flatZeroData(),
|
|
19196
19136
|
categories: fallbackCategories,
|
|
19197
19137
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
19198
19138
|
money: true,
|
|
@@ -19200,9 +19140,9 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19200
19140
|
error: false
|
|
19201
19141
|
},
|
|
19202
19142
|
"Avg Donation": {
|
|
19203
|
-
value: "$".concat(formatNumber(
|
|
19204
|
-
subValue:
|
|
19205
|
-
data:
|
|
19143
|
+
value: "$".concat(formatNumber(0)),
|
|
19144
|
+
subValue: formatGrowth$1(0),
|
|
19145
|
+
data: flatZeroData(),
|
|
19206
19146
|
categories: fallbackCategories,
|
|
19207
19147
|
icon: /*#__PURE__*/jsx(AverageDonationIcon, {}),
|
|
19208
19148
|
money: true,
|
|
@@ -19286,7 +19226,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19286
19226
|
}, [apiData === null || apiData === void 0 || (_apiData$topOrganicKe2 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe2 === void 0 ? void 0 : _apiData$topOrganicKe2.available, conversionSeries, donationsSeries, fallbackCategories, growth, hasOrganicOverview, organicUsersSeries, overview, dateName]);
|
|
19287
19227
|
var landingPagesData = useMemo(function () {
|
|
19288
19228
|
var pages = apiData === null || apiData === void 0 ? void 0 : apiData.topLandingPages;
|
|
19289
|
-
if (!hasOrganicOverview) return
|
|
19229
|
+
if (!hasOrganicOverview) return [];
|
|
19290
19230
|
if (!Array.isArray(pages) || pages.length === 0) return [];
|
|
19291
19231
|
return pages.map(function (item) {
|
|
19292
19232
|
var _item$visitors, _item$donations, _item$revenue, _item$conversionRate;
|
|
@@ -19301,7 +19241,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19301
19241
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topLandingPages, hasOrganicOverview]);
|
|
19302
19242
|
var keywordsData = useMemo(function () {
|
|
19303
19243
|
var keywords = apiData === null || apiData === void 0 ? void 0 : apiData.topOrganicKeywords;
|
|
19304
|
-
if (!hasOrganicOverview) return
|
|
19244
|
+
if (!hasOrganicOverview) return [];
|
|
19305
19245
|
if (!(keywords !== null && keywords !== void 0 && keywords.available) || !Array.isArray(keywords.data) || keywords.data.length === 0) {
|
|
19306
19246
|
return [];
|
|
19307
19247
|
}
|
|
@@ -19319,7 +19259,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19319
19259
|
var geographyData = useMemo(function () {
|
|
19320
19260
|
var _apiData$geographyIns;
|
|
19321
19261
|
var countries = apiData === null || apiData === void 0 || (_apiData$geographyIns = apiData.geographyInsights) === null || _apiData$geographyIns === void 0 ? void 0 : _apiData$geographyIns.countries;
|
|
19322
|
-
if (!hasOrganicOverview) return
|
|
19262
|
+
if (!hasOrganicOverview) return [];
|
|
19323
19263
|
if (!Array.isArray(countries) || countries.length === 0) return [];
|
|
19324
19264
|
return countries.map(function (item) {
|
|
19325
19265
|
var _item$visitors2, _item$percentage, _item$percentage2;
|
|
@@ -19334,7 +19274,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19334
19274
|
var _breakdown$totalVisit;
|
|
19335
19275
|
var breakdown = apiData === null || apiData === void 0 ? void 0 : apiData.sourceBreakdown;
|
|
19336
19276
|
var sources = breakdown === null || breakdown === void 0 ? void 0 : breakdown.data;
|
|
19337
|
-
if (!hasOrganicOverview) return
|
|
19277
|
+
if (!hasOrganicOverview) return [];
|
|
19338
19278
|
if (!Array.isArray(sources) || sources.length === 0) return null;
|
|
19339
19279
|
var colors = sources.map(function (_, index) {
|
|
19340
19280
|
return SOURCE_COLORS[index % SOURCE_COLORS.length];
|
|
@@ -19449,28 +19389,12 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19449
19389
|
children: /*#__PURE__*/jsx(DonorMixCard, {
|
|
19450
19390
|
title: "Source Breakdown",
|
|
19451
19391
|
subtitle: "Where organic visitors come from",
|
|
19452
|
-
series: (_sourceBreakdown$seri = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.series) !== null && _sourceBreakdown$seri !== void 0 ? _sourceBreakdown$seri : [
|
|
19453
|
-
labels: (_sourceBreakdown$labe = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.labels) !== null && _sourceBreakdown$labe !== void 0 ? _sourceBreakdown$labe : ["
|
|
19454
|
-
colors: (_sourceBreakdown$colo = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.colors) !== null && _sourceBreakdown$colo !== void 0 ? _sourceBreakdown$colo : ["#
|
|
19455
|
-
centerLabel: (_sourceBreakdown$cent = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerLabel) !== null && _sourceBreakdown$cent !== void 0 ? _sourceBreakdown$cent : "
|
|
19456
|
-
centerValue: (_sourceBreakdown$cent2 = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerValue) !== null && _sourceBreakdown$cent2 !== void 0 ? _sourceBreakdown$cent2 : "
|
|
19457
|
-
items: (_sourceBreakdown$item = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.items) !== null && _sourceBreakdown$item !== void 0 ? _sourceBreakdown$item : [
|
|
19458
|
-
label: "Google Search",
|
|
19459
|
-
val: "40.8%",
|
|
19460
|
-
color: "#4267B2"
|
|
19461
|
-
}, {
|
|
19462
|
-
label: "Direct",
|
|
19463
|
-
val: "35.1%",
|
|
19464
|
-
color: "#4285F4"
|
|
19465
|
-
}, {
|
|
19466
|
-
label: "Bing / Other",
|
|
19467
|
-
val: "14.2%",
|
|
19468
|
-
color: "#06510bff"
|
|
19469
|
-
}, {
|
|
19470
|
-
label: "Referalls",
|
|
19471
|
-
val: "3.3%",
|
|
19472
|
-
color: "#f2b61dff"
|
|
19473
|
-
}],
|
|
19392
|
+
series: (_sourceBreakdown$seri = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.series) !== null && _sourceBreakdown$seri !== void 0 ? _sourceBreakdown$seri : [0],
|
|
19393
|
+
labels: (_sourceBreakdown$labe = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.labels) !== null && _sourceBreakdown$labe !== void 0 ? _sourceBreakdown$labe : ["—"],
|
|
19394
|
+
colors: (_sourceBreakdown$colo = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.colors) !== null && _sourceBreakdown$colo !== void 0 ? _sourceBreakdown$colo : ["#E5E7EB"],
|
|
19395
|
+
centerLabel: (_sourceBreakdown$cent = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerLabel) !== null && _sourceBreakdown$cent !== void 0 ? _sourceBreakdown$cent : "visitors",
|
|
19396
|
+
centerValue: (_sourceBreakdown$cent2 = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.centerValue) !== null && _sourceBreakdown$cent2 !== void 0 ? _sourceBreakdown$cent2 : "0",
|
|
19397
|
+
items: (_sourceBreakdown$item = sourceBreakdown === null || sourceBreakdown === void 0 ? void 0 : sourceBreakdown.items) !== null && _sourceBreakdown$item !== void 0 ? _sourceBreakdown$item : [],
|
|
19474
19398
|
showBottomSummary: false,
|
|
19475
19399
|
sx: {
|
|
19476
19400
|
pb: 2
|
|
@@ -19486,7 +19410,7 @@ var OrganicSection = function OrganicSection(_ref) {
|
|
|
19486
19410
|
},
|
|
19487
19411
|
children: /*#__PURE__*/jsx(KeywordsCard, {
|
|
19488
19412
|
data: keywordsData,
|
|
19489
|
-
available: hasOrganicOverview ? (apiData === null || apiData === void 0 || (_apiData$topOrganicKe3 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe3 === void 0 ? void 0 : _apiData$topOrganicKe3.available) !== false :
|
|
19413
|
+
available: hasOrganicOverview ? (apiData === null || apiData === void 0 || (_apiData$topOrganicKe3 = apiData.topOrganicKeywords) === null || _apiData$topOrganicKe3 === void 0 ? void 0 : _apiData$topOrganicKe3.available) !== false : false,
|
|
19490
19414
|
numberOfDays: numberOfDays
|
|
19491
19415
|
})
|
|
19492
19416
|
}), /*#__PURE__*/jsx(Grid, {
|
|
@@ -20005,80 +19929,80 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20005
19929
|
if (!hasEmailOverview) {
|
|
20006
19930
|
return {
|
|
20007
19931
|
"Total Raised": {
|
|
20008
|
-
value: "$".concat(formatNumber(
|
|
20009
|
-
subValue:
|
|
19932
|
+
value: "$".concat(formatNumber(0)),
|
|
19933
|
+
subValue: formatGrowth(0),
|
|
20010
19934
|
icon: /*#__PURE__*/jsx(PaidOutlined, {}),
|
|
20011
19935
|
money: true,
|
|
20012
19936
|
error: false,
|
|
20013
19937
|
warning: false
|
|
20014
19938
|
},
|
|
20015
19939
|
Donations: {
|
|
20016
|
-
value:
|
|
20017
|
-
subValue:
|
|
19940
|
+
value: formatNumber(0),
|
|
19941
|
+
subValue: formatGrowth(0),
|
|
20018
19942
|
icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
|
|
20019
19943
|
money: false,
|
|
20020
19944
|
error: false,
|
|
20021
19945
|
warning: false
|
|
20022
19946
|
},
|
|
20023
19947
|
"Conversion Rate": {
|
|
20024
|
-
value: "
|
|
20025
|
-
subValue:
|
|
19948
|
+
value: "0.00%",
|
|
19949
|
+
subValue: formatGrowth(0),
|
|
20026
19950
|
icon: /*#__PURE__*/jsx(ConversionRateIcon, {}),
|
|
20027
19951
|
money: false,
|
|
20028
19952
|
error: false,
|
|
20029
19953
|
warning: false
|
|
20030
19954
|
},
|
|
20031
19955
|
CTR: {
|
|
20032
|
-
value: "
|
|
20033
|
-
subValue:
|
|
19956
|
+
value: "0.00%",
|
|
19957
|
+
subValue: formatGrowth(0),
|
|
20034
19958
|
icon: /*#__PURE__*/jsx(CtrIcon, {}),
|
|
20035
19959
|
money: false,
|
|
20036
19960
|
error: false,
|
|
20037
19961
|
warning: false
|
|
20038
19962
|
},
|
|
20039
19963
|
"Revenue Per Email": {
|
|
20040
|
-
value: "$".concat(formatNumber(
|
|
20041
|
-
subValue:
|
|
19964
|
+
value: "$".concat(formatNumber(0)),
|
|
19965
|
+
subValue: formatGrowth(0),
|
|
20042
19966
|
icon: /*#__PURE__*/jsx(RevenuePerEmailIcon, {}),
|
|
20043
19967
|
money: true,
|
|
20044
19968
|
error: false,
|
|
20045
19969
|
warning: false
|
|
20046
19970
|
},
|
|
20047
19971
|
"Open Rate": {
|
|
20048
|
-
value: "
|
|
20049
|
-
subValue:
|
|
19972
|
+
value: "0.00%",
|
|
19973
|
+
subValue: formatGrowth(0),
|
|
20050
19974
|
icon: /*#__PURE__*/jsx(Email, {}),
|
|
20051
19975
|
money: false,
|
|
20052
19976
|
error: false,
|
|
20053
19977
|
warning: false
|
|
20054
19978
|
},
|
|
20055
19979
|
Clicks: {
|
|
20056
|
-
value:
|
|
20057
|
-
subValue:
|
|
19980
|
+
value: formatNumber(0),
|
|
19981
|
+
subValue: formatGrowth(0),
|
|
20058
19982
|
icon: /*#__PURE__*/jsx(ClicksIcon, {}),
|
|
20059
19983
|
money: false,
|
|
20060
19984
|
error: false,
|
|
20061
19985
|
warning: false
|
|
20062
19986
|
},
|
|
20063
19987
|
"Unique Clicks": {
|
|
20064
|
-
value: formatNumber(
|
|
20065
|
-
subValue:
|
|
19988
|
+
value: formatNumber(0),
|
|
19989
|
+
subValue: formatGrowth(0),
|
|
20066
19990
|
icon: /*#__PURE__*/jsx(UniqueClicksIcon, {}),
|
|
20067
19991
|
money: false,
|
|
20068
19992
|
error: false,
|
|
20069
19993
|
warning: false
|
|
20070
19994
|
},
|
|
20071
19995
|
"Bounce Rate": {
|
|
20072
|
-
value: "
|
|
20073
|
-
subValue:
|
|
19996
|
+
value: "0.00%",
|
|
19997
|
+
subValue: formatGrowth(0),
|
|
20074
19998
|
icon: /*#__PURE__*/jsx(HighlightOff, {}),
|
|
20075
19999
|
money: false,
|
|
20076
20000
|
error: false,
|
|
20077
20001
|
warning: false
|
|
20078
20002
|
},
|
|
20079
20003
|
"Revenue Per Click": {
|
|
20080
|
-
value: "$".concat(formatNumber(
|
|
20081
|
-
subValue:
|
|
20004
|
+
value: "$".concat(formatNumber(0)),
|
|
20005
|
+
subValue: formatGrowth(0),
|
|
20082
20006
|
icon: /*#__PURE__*/jsx(RevenuePerClickIcon, {}),
|
|
20083
20007
|
money: true,
|
|
20084
20008
|
error: false,
|
|
@@ -20171,7 +20095,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20171
20095
|
}, [deliverability, deliverabilityGrowth, hasEmailOverview, overview, overviewGrowth, dateName]);
|
|
20172
20096
|
var campaignsRaisedData = useMemo(function () {
|
|
20173
20097
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByRaised;
|
|
20174
|
-
if (!hasEmailOverview) return
|
|
20098
|
+
if (!hasEmailOverview) return [];
|
|
20175
20099
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20176
20100
|
return campaigns.map(function (item) {
|
|
20177
20101
|
var _item$value2;
|
|
@@ -20184,7 +20108,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20184
20108
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByRaised, hasEmailOverview]);
|
|
20185
20109
|
var campaignsCtrData = useMemo(function () {
|
|
20186
20110
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByCtr;
|
|
20187
|
-
if (!hasEmailOverview) return
|
|
20111
|
+
if (!hasEmailOverview) return [];
|
|
20188
20112
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20189
20113
|
return campaigns.map(function (item) {
|
|
20190
20114
|
var _item$value3;
|
|
@@ -20197,7 +20121,7 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20197
20121
|
}, [apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByCtr, hasEmailOverview]);
|
|
20198
20122
|
var campaignsConversionData = useMemo(function () {
|
|
20199
20123
|
var campaigns = apiData === null || apiData === void 0 ? void 0 : apiData.topCampaignsByConversion;
|
|
20200
|
-
if (!hasEmailOverview) return
|
|
20124
|
+
if (!hasEmailOverview) return [];
|
|
20201
20125
|
if (!Array.isArray(campaigns) || campaigns.length === 0) return [];
|
|
20202
20126
|
return campaigns.map(function (item) {
|
|
20203
20127
|
var _item$value4;
|
|
@@ -20258,14 +20182,14 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20258
20182
|
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
20259
20183
|
title: "Open Rate Trend",
|
|
20260
20184
|
subtitle: "Daily - ".concat(daysLabel),
|
|
20261
|
-
value: hasEmailOverview ? "".concat(Number((_deliverability$openR2 = deliverability.openRate) !== null && _deliverability$openR2 !== void 0 ? _deliverability$openR2 : 0).toFixed(2), "%") : "
|
|
20262
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.openRate, true) :
|
|
20185
|
+
value: hasEmailOverview ? "".concat(Number((_deliverability$openR2 = deliverability.openRate) !== null && _deliverability$openR2 !== void 0 ? _deliverability$openR2 : 0).toFixed(2), "%") : "0.00%",
|
|
20186
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.openRate, true) : formatTrendBadge(0, true),
|
|
20263
20187
|
trendData: hasEmailOverview ? apiData === null || apiData === void 0 ? void 0 : apiData.openRateTrend : undefined,
|
|
20264
20188
|
series: [{
|
|
20265
20189
|
name: "Open Rate",
|
|
20266
|
-
data:
|
|
20190
|
+
data: hasEmailOverview && openRateTrend.data.length > 0 ? openRateTrend.data : [0]
|
|
20267
20191
|
}],
|
|
20268
|
-
categories:
|
|
20192
|
+
categories: hasEmailOverview && openRateTrend.categories.length > 0 ? openRateTrend.categories : ["—"],
|
|
20269
20193
|
colors: ["rgb(99, 99, 230)"],
|
|
20270
20194
|
yAxisMax: computeYAxisMax(openRateTrend.data, 5),
|
|
20271
20195
|
yAxisTickAmount: 3
|
|
@@ -20288,8 +20212,8 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20288
20212
|
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
20289
20213
|
title: "Clicks Trend",
|
|
20290
20214
|
subtitle: "Total + unique - ".concat(daysLabel),
|
|
20291
|
-
value: hasEmailOverview ? formatNumber((_deliverability$total2 = deliverability.totalClicks) !== null && _deliverability$total2 !== void 0 ? _deliverability$total2 : 0) :
|
|
20292
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.totalClicks) :
|
|
20215
|
+
value: hasEmailOverview ? formatNumber((_deliverability$total2 = deliverability.totalClicks) !== null && _deliverability$total2 !== void 0 ? _deliverability$total2 : 0) : formatNumber(0),
|
|
20216
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.totalClicks) : formatTrendBadge(0),
|
|
20293
20217
|
trendSeries: hasEmailOverview ? [{
|
|
20294
20218
|
name: "Total Clicks",
|
|
20295
20219
|
data: apiData === null || apiData === void 0 ? void 0 : apiData.totalClicksTrend
|
|
@@ -20300,13 +20224,13 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20300
20224
|
}] : undefined,
|
|
20301
20225
|
series: [{
|
|
20302
20226
|
name: "Total Clicks",
|
|
20303
|
-
data:
|
|
20227
|
+
data: hasEmailOverview && totalClicksTrend.data.length > 0 ? totalClicksTrend.data : [0]
|
|
20304
20228
|
}, {
|
|
20305
20229
|
name: "Unique Clicks",
|
|
20306
|
-
data:
|
|
20230
|
+
data: hasEmailOverview && uniqueClicksTrend.data.length > 0 ? uniqueClicksTrend.data : [0],
|
|
20307
20231
|
dashed: true
|
|
20308
20232
|
}],
|
|
20309
|
-
categories:
|
|
20233
|
+
categories: hasEmailOverview && totalClicksTrend.categories.length > 0 ? totalClicksTrend.categories : ["—"],
|
|
20310
20234
|
colors: ["#10B981", "#10B981"],
|
|
20311
20235
|
yAxisMax: computeYAxisMax([].concat(_toConsumableArray(totalClicksTrend.data), _toConsumableArray(uniqueClicksTrend.data)), 10),
|
|
20312
20236
|
yAxisTickAmount: 3,
|
|
@@ -20332,14 +20256,14 @@ var EmailSection = function EmailSection(_ref) {
|
|
|
20332
20256
|
children: /*#__PURE__*/jsx(EmailTrendCard, {
|
|
20333
20257
|
title: "Bounce Rate Trend",
|
|
20334
20258
|
subtitle: "Daily - lower is better",
|
|
20335
|
-
value: hasEmailOverview ? "".concat(Number((_deliverability$bounc2 = deliverability.bounceRate) !== null && _deliverability$bounc2 !== void 0 ? _deliverability$bounc2 : 0).toFixed(2), "%") : "
|
|
20336
|
-
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.bounceRate, true) :
|
|
20259
|
+
value: hasEmailOverview ? "".concat(Number((_deliverability$bounc2 = deliverability.bounceRate) !== null && _deliverability$bounc2 !== void 0 ? _deliverability$bounc2 : 0).toFixed(2), "%") : "0.00%",
|
|
20260
|
+
trend: hasEmailOverview ? formatTrendBadge(deliverabilityGrowth.bounceRate, true) : formatTrendBadge(0, true),
|
|
20337
20261
|
trendData: hasEmailOverview ? apiData === null || apiData === void 0 ? void 0 : apiData.bounceRateTrend : undefined,
|
|
20338
20262
|
series: [{
|
|
20339
20263
|
name: "Bounce Rate",
|
|
20340
|
-
data:
|
|
20264
|
+
data: hasEmailOverview && bounceRateTrend.data.length > 0 ? bounceRateTrend.data : [0]
|
|
20341
20265
|
}],
|
|
20342
|
-
categories:
|
|
20266
|
+
categories: hasEmailOverview && bounceRateTrend.categories.length > 0 ? bounceRateTrend.categories : ["—"],
|
|
20343
20267
|
colors: ["#f2994a"],
|
|
20344
20268
|
yAxisMax: computeYAxisMax(bounceRateTrend.data, 2.5),
|
|
20345
20269
|
yAxisTickAmount: 3
|