@ammarkhalidfarooq/dashboard-package 0.4.44 → 0.4.46

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
@@ -6238,42 +6238,95 @@ var OrganicSection = function OrganicSection(_ref) {
6238
6238
  var categories = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
6239
6239
  var metricInfo = {
6240
6240
  "Organic Users": {
6241
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaised) || "$240.9K",
6241
+ value: "".concat(formatNumber(8420)),
6242
6242
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedTrend) || "18% vs last month",
6243
6243
  data: [3200, 4100, 2800, 5600, 4200, 6100, 7500],
6244
- icon: PeopleAltOutlined
6244
+ icon: /*#__PURE__*/jsx(PeopleAltOutlined, {}),
6245
+ money: false,
6246
+ warning: false,
6247
+ error: false
6245
6248
  },
6246
6249
  "Search Clicks": {
6247
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaised) || "$222.3K",
6250
+ value: "".concat(formatNumber(5842)),
6248
6251
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.netRaisedSub) || "92.3% pass-through",
6249
6252
  data: [1500, 1800, 1600, 2200, 2000, 2400, 2800],
6250
- icon: SearchOutlined
6253
+ icon: /*#__PURE__*/jsx(SearchOutlined, {}),
6254
+ money: false,
6255
+ warning: false,
6256
+ error: false
6251
6257
  },
6252
6258
  Donations: {
6253
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.totalDonors) || "215",
6259
+ value: "".concat(formatNumber(420)),
6254
6260
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedTrend) || "18% vs last month",
6255
6261
  data: [15, 22, 18, 30, 25, 35, 42],
6256
- icon: FavoriteOutlined
6262
+ icon: /*#__PURE__*/jsx(FavoriteOutlined, {}),
6263
+ money: false,
6264
+ warning: false,
6265
+ error: false
6257
6266
  },
6258
6267
  "Conversion Rate": {
6259
6268
  value: "3.1%",
6260
6269
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.avgDonationTrend) || "8.4% vs last month",
6261
6270
  data: [2.5, 2.7, 2.6, 3.1, 3.0, 2.9, 3.1],
6262
- icon: Adjust
6271
+ icon: /*#__PURE__*/jsx(Adjust, {}),
6272
+ money: false,
6273
+ warning: false,
6274
+ error: false
6263
6275
  },
6264
6276
  "Revenue raised": {
6265
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.roas) || "3.0x",
6277
+ value: "$".concat(formatNumber(240398)),
6266
6278
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.roasTrend) || "0.4x vs last month",
6267
6279
  data: [2.5, 3.1, 2.8, 4.2, 3.8, 4.5, 5.2],
6268
- icon: PaidOutlined
6280
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
6281
+ money: true,
6282
+ warning: false,
6283
+ error: false
6269
6284
  },
6270
6285
  "Avg donation": {
6271
- value: (apiData === null || apiData === void 0 ? void 0 : apiData.conversion) || "1.7%",
6286
+ value: "$".concat(formatNumber(130.58)),
6272
6287
  subValue: (apiData === null || apiData === void 0 ? void 0 : apiData.totalRaisedTrend) || "18% vs last month",
6273
6288
  data: [110, 125, 120, 135, 130, 128, 130.58],
6274
- icon: PaidOutlined
6289
+ icon: /*#__PURE__*/jsx(PaidOutlined, {}),
6290
+ money: true,
6291
+ warning: false,
6292
+ error: false
6275
6293
  }
6276
6294
  };
6295
+ var renderCard = function renderCard(title) {
6296
+ return /*#__PURE__*/jsx(MetricCard
6297
+ // key={title}
6298
+ , {
6299
+ title: title,
6300
+ value: metricInfo[title].money ? metricInfo[title].value : metricInfo[title].value,
6301
+ caption: metricInfo[title].subValue,
6302
+ icon: metricInfo[title].icon,
6303
+ error: metricInfo[title].error,
6304
+ active: activeMetric === title,
6305
+ onClick: function onClick() {
6306
+ return setActiveMetric(title);
6307
+ },
6308
+ sx: metricInfo[title].error ? {
6309
+ border: "2px solid #ef4444",
6310
+ bgcolor: "#fffafa"
6311
+ } : {}
6312
+ })
6313
+ // <DisplayCard
6314
+ // key={title}
6315
+ // title={title}
6316
+ // value={metricInfo[title].value}
6317
+ // subValue={metricInfo[title].subValue}
6318
+ // icon={metricInfo[title].icon}
6319
+ // onClick={() => setActiveMetric(title)}
6320
+ // isActive={activeMetric === title}
6321
+ // sx={{
6322
+ // // border:
6323
+ // // activeMetric === title
6324
+ // // ? "2px solid rgb(99, 99, 230)"
6325
+ // // : "2px solid #f0f0f0",
6326
+ // }}
6327
+ // />
6328
+ ;
6329
+ };
6277
6330
  var selectedInfo = metricInfo[activeMetric];
6278
6331
  var mainChart = {
6279
6332
  label: activeMetric,
@@ -6285,30 +6338,17 @@ var OrganicSection = function OrganicSection(_ref) {
6285
6338
  return /*#__PURE__*/jsxs(Fragment, {
6286
6339
  children: [/*#__PURE__*/jsx(Box, {
6287
6340
  sx: {
6288
- display: "flex",
6341
+ display: "grid",
6342
+ gridTemplateColumns: {
6343
+ xs: "1fr",
6344
+ sm: "1fr 1fr",
6345
+ md: "1fr 1fr 1fr",
6346
+ lg: "repeat(6, 1fr)"
6347
+ },
6289
6348
  gap: 2,
6290
- mb: 2,
6291
- flexWrap: "wrap"
6349
+ mb: 1
6292
6350
  },
6293
- children: Object.keys(metricInfo).map(function (title) {
6294
- return /*#__PURE__*/jsx(DisplayCard, {
6295
- title: title,
6296
- value: metricInfo[title].value,
6297
- subValue: metricInfo[title].subValue,
6298
- icon: metricInfo[title].icon,
6299
- onClick: function onClick() {
6300
- return setActiveMetric(title);
6301
- },
6302
- isActive: activeMetric === title,
6303
- sx: {
6304
- flex: 1
6305
- // border:
6306
- // activeMetric === title
6307
- // ? "2px solid rgb(99, 99, 230)"
6308
- // : "2px solid #f0f0f0",
6309
- }
6310
- }, title);
6311
- })
6351
+ children: Object.keys(metricInfo).map(renderCard)
6312
6352
  }), /*#__PURE__*/jsxs(Grid, {
6313
6353
  container: true,
6314
6354
  spacing: 3,