@ammarkhalidfarooq/dashboard-package 0.2.4 → 0.2.6

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
@@ -1,5 +1,5 @@
1
1
  import React, { Suspense, lazy, useState } from 'react';
2
- import { Box, Button, Menu, MenuItem, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, Divider, LinearProgress, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from '@mui/material';
2
+ import { Box, Button, Menu, MenuItem, Grid, Card, CardContent, Typography, IconButton, ThemeProvider, CircularProgress, LinearProgress, Divider, TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from '@mui/material';
3
3
  import { MoreHoriz, InfoOutlined, MoreVert, Check, Settings } from '@mui/icons-material';
4
4
  import { createTheme, useTheme } from '@mui/material/styles';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -571,7 +571,9 @@ var Dashboard = function Dashboard(_ref) {
571
571
  _ref$categories = _ref.categories,
572
572
  categories = _ref$categories === void 0 ? ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep"] : _ref$categories,
573
573
  _ref$apiData = _ref.apiData,
574
- apiData = _ref$apiData === void 0 ? {} : _ref$apiData;
574
+ apiData = _ref$apiData === void 0 ? {} : _ref$apiData,
575
+ _ref$performanceData = _ref.performanceData,
576
+ performanceData = _ref$performanceData === void 0 ? {} : _ref$performanceData;
575
577
  var _React$useState = React.useState(initialMetric),
576
578
  _React$useState2 = _slicedToArray(_React$useState, 2),
577
579
  metric = _React$useState2[0];
@@ -648,7 +650,8 @@ var Dashboard = function Dashboard(_ref) {
648
650
  children: /*#__PURE__*/jsx(CircularProgress, {})
649
651
  }),
650
652
  children: /*#__PURE__*/jsx(PerformanceSection$1, {
651
- apiData: apiData
653
+ apiData: apiData,
654
+ performanceData: performanceData
652
655
  })
653
656
  }), /*#__PURE__*/jsx(Suspense, {
654
657
  fallback: /*#__PURE__*/jsx(Box, {
@@ -742,6 +745,508 @@ var DisplayCard = function DisplayCard(_ref) {
742
745
  });
743
746
  };
744
747
 
748
+ var CardWrapper = function CardWrapper(_ref) {
749
+ var title = _ref.title,
750
+ children = _ref.children;
751
+ return /*#__PURE__*/jsx(Card, {
752
+ sx: {
753
+ width: "100%",
754
+ display: "flex",
755
+ flexDirection: "column",
756
+ boxShadow: "0 4px 24px rgba(0,0,0,0.06)",
757
+ borderRadius: 4,
758
+ border: "1px solid #f0f0f0",
759
+ height: "100%"
760
+ },
761
+ children: /*#__PURE__*/jsxs(CardContent, {
762
+ sx: {
763
+ p: 3
764
+ },
765
+ children: [/*#__PURE__*/jsx(Typography, {
766
+ variant: "subtitle2",
767
+ sx: {
768
+ color: "#000000ff",
769
+ fontWeight: 600,
770
+ textTransform: "uppercase",
771
+ letterSpacing: "0.5px",
772
+ mb: 3,
773
+ textAlign: "left"
774
+ },
775
+ children: title
776
+ }), /*#__PURE__*/jsx(Box, {
777
+ sx: {
778
+ display: "flex",
779
+ flexDirection: "column",
780
+ gap: 2
781
+ },
782
+ children: children
783
+ })]
784
+ })
785
+ });
786
+ };
787
+ var LandingPagesCard = function LandingPagesCard() {
788
+ var data = [{
789
+ page: "/zakat",
790
+ users: "612 users",
791
+ cvr: "1.3% CVR",
792
+ color: "#2E7D32"
793
+ }, {
794
+ page: "/ramadan",
795
+ users: "488 users",
796
+ cvr: "1.1% CVR",
797
+ color: "#2E7D32"
798
+ }, {
799
+ page: "/donate",
800
+ users: "421 users",
801
+ cvr: "0.7% CVR",
802
+ color: "#ED6C02"
803
+ }, {
804
+ page: "/campaigns",
805
+ users: "380 users",
806
+ cvr: "0.5% CVR",
807
+ color: "#ED6C02"
808
+ }, {
809
+ page: "/sadaqah",
810
+ users: "290 users",
811
+ cvr: "0.9% CVR",
812
+ color: "#2E7D32"
813
+ }];
814
+ return /*#__PURE__*/jsx(CardWrapper, {
815
+ title: "Top Landing Pages",
816
+ children: data.map(function (item, index) {
817
+ return /*#__PURE__*/jsxs(Box, {
818
+ sx: {
819
+ display: "flex",
820
+ justifyContent: "space-between",
821
+ alignItems: "center"
822
+ },
823
+ children: [/*#__PURE__*/jsx(Typography, {
824
+ variant: "body2",
825
+ sx: {
826
+ fontWeight: 500,
827
+ color: "#333"
828
+ },
829
+ children: item.page
830
+ }), /*#__PURE__*/jsxs(Box, {
831
+ sx: {
832
+ display: "flex",
833
+ gap: 2,
834
+ alignItems: "center"
835
+ },
836
+ children: [/*#__PURE__*/jsx(Typography, {
837
+ variant: "body2",
838
+ sx: {
839
+ color: "#606062",
840
+ fontWeight: 500
841
+ },
842
+ children: item.users
843
+ }), /*#__PURE__*/jsx(Typography, {
844
+ variant: "body2",
845
+ sx: {
846
+ color: item.color,
847
+ fontWeight: 600,
848
+ minWidth: "70px",
849
+ textAlign: "right"
850
+ },
851
+ children: item.cvr
852
+ })]
853
+ })]
854
+ }, index);
855
+ })
856
+ });
857
+ };
858
+ var KeywordsCard = function KeywordsCard() {
859
+ var data = [{
860
+ keyword: "zakat calculator",
861
+ volume: "320",
862
+ rank: "#3",
863
+ color: "#E8F5E9",
864
+ textColor: "#2E7D32"
865
+ }, {
866
+ keyword: "donate to ramadan",
867
+ volume: "214",
868
+ rank: "#5",
869
+ color: "#E8F5E9",
870
+ textColor: "#2E7D32"
871
+ }, {
872
+ keyword: "islamic charity uk",
873
+ volume: "198",
874
+ rank: "#11",
875
+ color: "#FFF3E0",
876
+ textColor: "#ED6C02"
877
+ }, {
878
+ keyword: "madinah fundraising",
879
+ volume: "176",
880
+ rank: "#1",
881
+ color: "#E8F5E9",
882
+ textColor: "#2E7D32"
883
+ }, {
884
+ keyword: "online sadaqah",
885
+ volume: "142",
886
+ rank: "#8",
887
+ color: "#FFF3E0",
888
+ textColor: "#ED6C02"
889
+ }];
890
+ return /*#__PURE__*/jsx(CardWrapper, {
891
+ title: "Top Keywords",
892
+ children: data.map(function (item, index) {
893
+ return /*#__PURE__*/jsxs(Box, {
894
+ sx: {
895
+ display: "flex",
896
+ justifyContent: "space-between",
897
+ alignItems: "center"
898
+ },
899
+ children: [/*#__PURE__*/jsx(Typography, {
900
+ variant: "body2",
901
+ sx: {
902
+ fontWeight: 500,
903
+ color: "#333"
904
+ },
905
+ children: item.keyword
906
+ }), /*#__PURE__*/jsxs(Box, {
907
+ sx: {
908
+ display: "flex",
909
+ gap: 2,
910
+ alignItems: "center"
911
+ },
912
+ children: [/*#__PURE__*/jsx(Typography, {
913
+ variant: "body2",
914
+ sx: {
915
+ color: "#606062",
916
+ fontWeight: 500
917
+ },
918
+ children: item.volume
919
+ }), /*#__PURE__*/jsx(Box, {
920
+ sx: {
921
+ bgcolor: item.color,
922
+ color: item.textColor,
923
+ px: 1,
924
+ py: 0.2,
925
+ borderRadius: 1,
926
+ fontSize: "12px",
927
+ fontWeight: 600,
928
+ minWidth: "30px",
929
+ textAlign: "center"
930
+ },
931
+ children: item.rank
932
+ })]
933
+ })]
934
+ }, index);
935
+ })
936
+ });
937
+ };
938
+ var GeographyCard = function GeographyCard() {
939
+ var data = [{
940
+ code: "GB",
941
+ country: "United Kingdom",
942
+ percentage: 60
943
+ }, {
944
+ code: "US",
945
+ country: "United States",
946
+ percentage: 14
947
+ }, {
948
+ code: "AU",
949
+ country: "Australia",
950
+ percentage: 8
951
+ }, {
952
+ code: "CA",
953
+ country: "Canada",
954
+ percentage: 6
955
+ }, {
956
+ code: "AE",
957
+ country: "UAE",
958
+ percentage: 4
959
+ }];
960
+ return /*#__PURE__*/jsx(CardWrapper, {
961
+ title: "Geography Insights",
962
+ children: data.map(function (item, index) {
963
+ return /*#__PURE__*/jsxs(Box, {
964
+ sx: {
965
+ display: "flex",
966
+ alignItems: "center",
967
+ gap: 2
968
+ },
969
+ children: [/*#__PURE__*/jsx(Typography, {
970
+ variant: "body2",
971
+ sx: {
972
+ fontWeight: 600,
973
+ color: "#606062",
974
+ minWidth: "25px"
975
+ },
976
+ children: item.code
977
+ }), /*#__PURE__*/jsx(Typography, {
978
+ variant: "body2",
979
+ sx: {
980
+ fontWeight: 500,
981
+ color: "#333",
982
+ minWidth: "120px",
983
+ textAlign: "left"
984
+ },
985
+ children: item.country
986
+ }), /*#__PURE__*/jsx(Box, {
987
+ sx: {
988
+ flexGrow: 1,
989
+ mx: 2
990
+ },
991
+ children: /*#__PURE__*/jsx(LinearProgress, {
992
+ variant: "determinate",
993
+ value: item.percentage,
994
+ sx: {
995
+ height: 6,
996
+ borderRadius: 3,
997
+ bgcolor: "#F0F0F0",
998
+ "& .MuiLinearProgress-bar": {
999
+ bgcolor: "#3498DB",
1000
+ borderRadius: 3
1001
+ }
1002
+ }
1003
+ })
1004
+ }), /*#__PURE__*/jsxs(Typography, {
1005
+ variant: "body2",
1006
+ sx: {
1007
+ fontWeight: 600,
1008
+ color: "#333",
1009
+ minWidth: "35px",
1010
+ textAlign: "right"
1011
+ },
1012
+ children: [item.percentage, "%"]
1013
+ })]
1014
+ }, index);
1015
+ })
1016
+ });
1017
+ };
1018
+ var TopCampaignsRaisedCard = function TopCampaignsRaisedCard() {
1019
+ var data = [{
1020
+ name: "Ramadan Week 3 Appeal",
1021
+ raised: "$1,210 raised",
1022
+ donors: "18 donors",
1023
+ badge: "4.1% CVR",
1024
+ color: "#E8F5E9",
1025
+ textColor: "#2E7D32"
1026
+ }, {
1027
+ name: "Zakat Due Reminder",
1028
+ raised: "$740 raised",
1029
+ donors: "8 donors",
1030
+ badge: "3.2% CVR",
1031
+ color: "#E8F5E9",
1032
+ textColor: "#2E7D32"
1033
+ }, {
1034
+ name: "Last 10 Nights Giving",
1035
+ raised: "$265 raised",
1036
+ donors: "3 donors",
1037
+ badge: "1.8% CVR",
1038
+ color: "#FFF3E0",
1039
+ textColor: "#ED6C02"
1040
+ }];
1041
+ return /*#__PURE__*/jsx(CardWrapper, {
1042
+ title: "Top Campaigns - Total Raised",
1043
+ children: data.map(function (item, index) {
1044
+ return /*#__PURE__*/jsxs(Box, {
1045
+ sx: {
1046
+ display: "flex",
1047
+ flexDirection: "column",
1048
+ gap: 0.5
1049
+ },
1050
+ children: [/*#__PURE__*/jsx(Typography, {
1051
+ variant: "body2",
1052
+ sx: {
1053
+ fontWeight: 600,
1054
+ color: "#333",
1055
+ textAlign: "left"
1056
+ },
1057
+ children: item.name
1058
+ }), /*#__PURE__*/jsxs(Box, {
1059
+ sx: {
1060
+ display: "flex",
1061
+ alignItems: "center",
1062
+ gap: 1.5
1063
+ },
1064
+ children: [/*#__PURE__*/jsx(Typography, {
1065
+ variant: "caption",
1066
+ sx: {
1067
+ color: "#606062",
1068
+ fontWeight: 500
1069
+ },
1070
+ children: item.raised
1071
+ }), /*#__PURE__*/jsx(Typography, {
1072
+ variant: "caption",
1073
+ sx: {
1074
+ color: "#606062",
1075
+ fontWeight: 500
1076
+ },
1077
+ children: item.donors
1078
+ }), /*#__PURE__*/jsx(Box, {
1079
+ sx: {
1080
+ bgcolor: item.color,
1081
+ color: item.textColor,
1082
+ px: 1,
1083
+ py: 0.2,
1084
+ borderRadius: 1,
1085
+ fontSize: "11px",
1086
+ fontWeight: 600
1087
+ },
1088
+ children: item.badge
1089
+ })]
1090
+ })]
1091
+ }, index);
1092
+ })
1093
+ });
1094
+ };
1095
+ var TopCampaignsCTRCard = function TopCampaignsCTRCard() {
1096
+ var data = [{
1097
+ name: "Ramadan Week 3 Appeal",
1098
+ ctr: "11.2% CTR",
1099
+ clicks: "480 clicks",
1100
+ badge: "34.8% OR",
1101
+ color: "#E8F5E9",
1102
+ textColor: "#2E7D32"
1103
+ }, {
1104
+ name: "Last 10 Nights Giving",
1105
+ ctr: "9.8% CTR",
1106
+ clicks: "410 clicks",
1107
+ badge: "38.1% OR",
1108
+ color: "#E8F5E9",
1109
+ textColor: "#2E7D32"
1110
+ }, {
1111
+ name: "Zakat Due Reminder",
1112
+ ctr: "6.4% CTR",
1113
+ clicks: "314 clicks",
1114
+ badge: "31.4% OR",
1115
+ color: "#FFF3E0",
1116
+ textColor: "#ED6C02"
1117
+ }];
1118
+ return /*#__PURE__*/jsx(CardWrapper, {
1119
+ title: "Top Campaigns - CTR",
1120
+ children: data.map(function (item, index) {
1121
+ return /*#__PURE__*/jsxs(Box, {
1122
+ sx: {
1123
+ display: "flex",
1124
+ flexDirection: "column",
1125
+ gap: 0.5
1126
+ },
1127
+ children: [/*#__PURE__*/jsx(Typography, {
1128
+ variant: "body2",
1129
+ sx: {
1130
+ fontWeight: 600,
1131
+ color: "#333",
1132
+ textAlign: "left"
1133
+ },
1134
+ children: item.name
1135
+ }), /*#__PURE__*/jsxs(Box, {
1136
+ sx: {
1137
+ display: "flex",
1138
+ alignItems: "center",
1139
+ gap: 1.5
1140
+ },
1141
+ children: [/*#__PURE__*/jsx(Typography, {
1142
+ variant: "caption",
1143
+ sx: {
1144
+ color: "#606062",
1145
+ fontWeight: 500
1146
+ },
1147
+ children: item.ctr
1148
+ }), /*#__PURE__*/jsx(Typography, {
1149
+ variant: "caption",
1150
+ sx: {
1151
+ color: "#606062",
1152
+ fontWeight: 500
1153
+ },
1154
+ children: item.clicks
1155
+ }), /*#__PURE__*/jsx(Box, {
1156
+ sx: {
1157
+ bgcolor: item.color,
1158
+ color: item.textColor,
1159
+ px: 1,
1160
+ py: 0.2,
1161
+ borderRadius: 1,
1162
+ fontSize: "11px",
1163
+ fontWeight: 600
1164
+ },
1165
+ children: item.badge
1166
+ })]
1167
+ })]
1168
+ }, index);
1169
+ })
1170
+ });
1171
+ };
1172
+ var TopCampaignsConvRateCard = function TopCampaignsConvRateCard() {
1173
+ var data = [{
1174
+ name: "Ramadan Week 3 Appeal",
1175
+ cvr: "4.1% CVR",
1176
+ raised: "$1,210 raised",
1177
+ badge: "$2.52 RPC",
1178
+ color: "#E8F5E9",
1179
+ textColor: "#2E7D32"
1180
+ }, {
1181
+ name: "Zakat Due Reminder",
1182
+ cvr: "3.2% CVR",
1183
+ raised: "$740 raised",
1184
+ badge: "$2.36 RPC",
1185
+ color: "#E8F5E9",
1186
+ textColor: "#2E7D32"
1187
+ }, {
1188
+ name: "Last 10 Nights Giving",
1189
+ cvr: "1.8% CVR",
1190
+ raised: "$265 raised",
1191
+ badge: "$0.65 RPC",
1192
+ color: "#FFF3E0",
1193
+ textColor: "#ED6C02"
1194
+ }];
1195
+ return /*#__PURE__*/jsx(CardWrapper, {
1196
+ title: "Top Campaigns - Conv. Rate",
1197
+ children: data.map(function (item, index) {
1198
+ return /*#__PURE__*/jsxs(Box, {
1199
+ sx: {
1200
+ display: "flex",
1201
+ flexDirection: "column",
1202
+ gap: 0.5
1203
+ },
1204
+ children: [/*#__PURE__*/jsx(Typography, {
1205
+ variant: "body2",
1206
+ sx: {
1207
+ fontWeight: 600,
1208
+ color: "#333",
1209
+ textAlign: "left"
1210
+ },
1211
+ children: item.name
1212
+ }), /*#__PURE__*/jsxs(Box, {
1213
+ sx: {
1214
+ display: "flex",
1215
+ alignItems: "center",
1216
+ gap: 1.5
1217
+ },
1218
+ children: [/*#__PURE__*/jsx(Typography, {
1219
+ variant: "caption",
1220
+ sx: {
1221
+ color: "#606062",
1222
+ fontWeight: 500
1223
+ },
1224
+ children: item.cvr
1225
+ }), /*#__PURE__*/jsx(Typography, {
1226
+ variant: "caption",
1227
+ sx: {
1228
+ color: "#606062",
1229
+ fontWeight: 500
1230
+ },
1231
+ children: item.raised
1232
+ }), /*#__PURE__*/jsx(Box, {
1233
+ sx: {
1234
+ bgcolor: item.color,
1235
+ color: item.textColor,
1236
+ px: 1,
1237
+ py: 0.2,
1238
+ borderRadius: 1,
1239
+ fontSize: "11px",
1240
+ fontWeight: 600
1241
+ },
1242
+ children: item.badge
1243
+ })]
1244
+ })]
1245
+ }, index);
1246
+ })
1247
+ });
1248
+ };
1249
+
745
1250
  var OrganicSection = function OrganicSection(_ref) {
746
1251
  var _ref$apiData = _ref.apiData,
747
1252
  apiData = _ref$apiData === void 0 ? {} : _ref$apiData;
@@ -768,9 +1273,9 @@ var OrganicSection = function OrganicSection(_ref) {
768
1273
  categories: categories
769
1274
  };
770
1275
  return /*#__PURE__*/jsxs(Fragment, {
771
- children: [" ", /*#__PURE__*/jsxs(Box, {
1276
+ children: [" ", /*#__PURE__*/jsxs(Box, {
772
1277
  sx: {
773
- display: 'flex',
1278
+ display: "flex",
774
1279
  gap: 2,
775
1280
  mb: 5
776
1281
  },
@@ -837,6 +1342,177 @@ var OrganicSection = function OrganicSection(_ref) {
837
1342
  type: "donut",
838
1343
  metric: "Revenue"
839
1344
  })]
1345
+ }), /*#__PURE__*/jsxs(Grid, {
1346
+ container: true,
1347
+ spacing: 3,
1348
+ sx: {
1349
+ mt: 4
1350
+ },
1351
+ children: [/*#__PURE__*/jsx(Grid, {
1352
+ item: true,
1353
+ xs: 12,
1354
+ md: 4,
1355
+ children: /*#__PURE__*/jsx(LandingPagesCard, {})
1356
+ }), /*#__PURE__*/jsx(Grid, {
1357
+ item: true,
1358
+ xs: 12,
1359
+ md: 4,
1360
+ children: /*#__PURE__*/jsx(KeywordsCard, {})
1361
+ }), /*#__PURE__*/jsx(Grid, {
1362
+ item: true,
1363
+ xs: 12,
1364
+ md: 4,
1365
+ children: /*#__PURE__*/jsx(GeographyCard, {})
1366
+ })]
1367
+ })]
1368
+ });
1369
+ };
1370
+
1371
+ var EmailSection = function EmailSection() {
1372
+ var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
1373
+ var dailyPerformance = {
1374
+ label: "Clicks & Unique Clicks Trend",
1375
+ series: [{
1376
+ name: "Clicks",
1377
+ data: [3200, 4100, 2800, 5600, 4200, 6100, 7500]
1378
+ }, {
1379
+ name: "Unique Clicks",
1380
+ data: [800, 950, 700, 1100, 900, 1200, 1300]
1381
+ }],
1382
+ categories: categories
1383
+ };
1384
+ var spendAllocation = {
1385
+ label: "Bounce Rate Trend",
1386
+ data: [20, 25, 30, 35, 40, 45, 50],
1387
+ categories: categories
1388
+ };
1389
+ var roasTrend = {
1390
+ label: "Open Rate Trend",
1391
+ data: [20, 25, 30, 35, 40, 45, 50],
1392
+ categories: categories
1393
+ };
1394
+ return /*#__PURE__*/jsxs(Fragment, {
1395
+ children: [/*#__PURE__*/jsxs(Box, {
1396
+ sx: {
1397
+ display: "flex",
1398
+ gap: 2,
1399
+ mb: 2
1400
+ },
1401
+ children: [/*#__PURE__*/jsx(DisplayCard, {
1402
+ title: "Open Rate",
1403
+ value: "32%",
1404
+ sx: {
1405
+ flex: 1
1406
+ }
1407
+ }), /*#__PURE__*/jsx(DisplayCard, {
1408
+ title: "Bounce Rate",
1409
+ value: "1.8%",
1410
+ sx: {
1411
+ flex: 1
1412
+ }
1413
+ }), /*#__PURE__*/jsx(DisplayCard, {
1414
+ title: "Clicks",
1415
+ value: "1,204",
1416
+ sx: {
1417
+ flex: 1
1418
+ }
1419
+ }), /*#__PURE__*/jsx(DisplayCard, {
1420
+ title: "Unique Clicks",
1421
+ value: "987",
1422
+ sx: {
1423
+ flex: 1
1424
+ }
1425
+ }), /*#__PURE__*/jsx(DisplayCard, {
1426
+ title: "CTR",
1427
+ value: "4.8%",
1428
+ sx: {
1429
+ flex: 1
1430
+ }
1431
+ })]
1432
+ }), /*#__PURE__*/jsxs(Box, {
1433
+ sx: {
1434
+ display: "flex",
1435
+ gap: 2
1436
+ },
1437
+ children: [/*#__PURE__*/jsx(DisplayCard, {
1438
+ title: "Donations",
1439
+ value: "29",
1440
+ sx: {
1441
+ flex: 1
1442
+ }
1443
+ }), /*#__PURE__*/jsx(DisplayCard, {
1444
+ title: "CONV.Rate",
1445
+ value: "2.9%",
1446
+ sx: {
1447
+ flex: 1
1448
+ }
1449
+ }), /*#__PURE__*/jsx(DisplayCard, {
1450
+ title: "RPC",
1451
+ value: "$1.84",
1452
+ sx: {
1453
+ flex: 1
1454
+ }
1455
+ }), /*#__PURE__*/jsx(DisplayCard, {
1456
+ title: "TOTAL RAISED (EMAIL)",
1457
+ value: "$2,215",
1458
+ sx: {
1459
+ flex: 1
1460
+ }
1461
+ }), /*#__PURE__*/jsx(DisplayCard, {
1462
+ title: "AVG DONATION",
1463
+ value: "$76.4",
1464
+ sx: {
1465
+ flex: 1
1466
+ }
1467
+ })]
1468
+ }), /*#__PURE__*/jsxs(Grid, {
1469
+ container: true,
1470
+ spacing: 3,
1471
+ sx: {
1472
+ mt: 4
1473
+ },
1474
+ children: [/*#__PURE__*/jsx(RenderChartCard, {
1475
+ item: roasTrend,
1476
+ index: 2,
1477
+ md: 4,
1478
+ type: "area",
1479
+ metric: "ROAS",
1480
+ isPrimary: true
1481
+ }), /*#__PURE__*/jsx(RenderChartCard, {
1482
+ item: dailyPerformance,
1483
+ index: 0,
1484
+ md: 4,
1485
+ type: "bar",
1486
+ metric: "Revenue"
1487
+ }), /*#__PURE__*/jsx(RenderChartCard, {
1488
+ item: spendAllocation,
1489
+ index: 1,
1490
+ md: 4,
1491
+ type: "area",
1492
+ metric: "Revenue"
1493
+ })]
1494
+ }), /*#__PURE__*/jsxs(Grid, {
1495
+ container: true,
1496
+ spacing: 3,
1497
+ sx: {
1498
+ mt: 4
1499
+ },
1500
+ children: [/*#__PURE__*/jsx(Grid, {
1501
+ item: true,
1502
+ xs: 12,
1503
+ md: 4,
1504
+ children: /*#__PURE__*/jsx(TopCampaignsRaisedCard, {})
1505
+ }), /*#__PURE__*/jsx(Grid, {
1506
+ item: true,
1507
+ xs: 12,
1508
+ md: 4,
1509
+ children: /*#__PURE__*/jsx(TopCampaignsCTRCard, {})
1510
+ }), /*#__PURE__*/jsx(Grid, {
1511
+ item: true,
1512
+ xs: 12,
1513
+ md: 4,
1514
+ children: /*#__PURE__*/jsx(TopCampaignsConvRateCard, {})
1515
+ })]
840
1516
  })]
841
1517
  });
842
1518
  };
@@ -940,7 +1616,7 @@ var NewOverview = function NewOverview(_ref) {
940
1616
  }) : categories;
941
1617
  var primaryCharts = [{
942
1618
  label: "Total Revenue",
943
- value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === 'string' ? apiData.totalRevenue : "$9,200.00",
1619
+ value: totalRevData.length > 0 ? "$".concat(totalRevTotal.toLocaleString()) : typeof (apiData === null || apiData === void 0 ? void 0 : apiData.totalRevenue) === "string" ? apiData.totalRevenue : "$9,200.00",
944
1620
  subValue: "Total Donations: ".concat((apiData === null || apiData === void 0 ? void 0 : apiData.totalDonations) || 215),
945
1621
  data: totalRevValues,
946
1622
  categories: totalRevCategories,
@@ -1088,9 +1764,9 @@ var NewOverview = function NewOverview(_ref) {
1088
1764
  }), /*#__PURE__*/jsxs(Suspense, {
1089
1765
  fallback: /*#__PURE__*/jsx(Box, {
1090
1766
  sx: {
1091
- display: 'flex',
1092
- justifyContent: 'center',
1093
- alignItems: 'center',
1767
+ display: "flex",
1768
+ justifyContent: "center",
1769
+ alignItems: "center",
1094
1770
  py: 10
1095
1771
  },
1096
1772
  children: /*#__PURE__*/jsx(CircularProgress, {
@@ -1116,7 +1792,7 @@ var NewOverview = function NewOverview(_ref) {
1116
1792
  sx: {
1117
1793
  p: 2
1118
1794
  },
1119
- children: "Email Section Content (Coming Soon)"
1795
+ children: /*#__PURE__*/jsx(EmailSection, {})
1120
1796
  })]
1121
1797
  })]
1122
1798
  });
@@ -1129,14 +1805,26 @@ var index$5 = /*#__PURE__*/Object.freeze({
1129
1805
 
1130
1806
  var PerformanceSection = function PerformanceSection(_ref) {
1131
1807
  _ref.title;
1808
+ var _ref$performanceData = _ref.performanceData,
1809
+ performanceData = _ref$performanceData === void 0 ? {} : _ref$performanceData;
1132
1810
  var revenueData = [3000, 4500, 4200, 5800, 5200, 7100, 8500, 9200, 5000];
1133
1811
  var visitorsData = [100, 200, 150, 250, 300, 275, 325, 350, 280];
1134
1812
  var categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'];
1813
+ var revPerVisData = Array.isArray(performanceData === null || performanceData === void 0 ? void 0 : performanceData.revenuePerVisitor) ? performanceData.revenuePerVisitor : [];
1814
+ var revPerVisValues = revPerVisData.length > 0 ? revPerVisData.map(function (item) {
1815
+ return item.value;
1816
+ }) : revenueData;
1817
+ var revPerVisCategories = revPerVisData.length > 0 ? revPerVisData.map(function (item) {
1818
+ return item.date;
1819
+ }) : categories;
1820
+ var revPerVisTotal = revPerVisData.length > 0 ? revPerVisValues.reduce(function (sum, val) {
1821
+ return sum + val;
1822
+ }, 0) / revPerVisValues.length : 5.12;
1135
1823
  var primaryCharts = [{
1136
1824
  label: 'Revenue per Visitor',
1137
- value: '$5.12',
1138
- data: revenueData,
1139
- categories: categories
1825
+ value: performanceData !== null && performanceData !== void 0 && performanceData.revenuePerVisitor ? "$".concat(revPerVisTotal.toFixed(2)) : '$5.12',
1826
+ data: revPerVisValues,
1827
+ categories: revPerVisCategories
1140
1828
  }, {
1141
1829
  label: 'Visitors',
1142
1830
  value: '1200',