@mbpockets/shared-ui 0.2.5 → 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.mjs CHANGED
@@ -1045,7 +1045,9 @@ var BaseSearchResultCard_default = BaseSearchResultCard;
1045
1045
  var PlayerResultCard = ({
1046
1046
  result,
1047
1047
  onClick,
1048
- tags
1048
+ tags,
1049
+ showEventTag,
1050
+ eventTagId
1049
1051
  }) => {
1050
1052
  const firstLetter = result.title.charAt(0).toUpperCase();
1051
1053
  const getAvatarColor = (name) => {
@@ -1087,7 +1089,17 @@ var PlayerResultCard = ({
1087
1089
  children: !result.imageUrl && firstLetter
1088
1090
  }
1089
1091
  );
1090
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: playerIcon, tags });
1092
+ return /* @__PURE__ */ jsx(
1093
+ BaseSearchResultCard_default,
1094
+ {
1095
+ result,
1096
+ onClick,
1097
+ icon: playerIcon,
1098
+ tags,
1099
+ showEventTag,
1100
+ eventTagId
1101
+ }
1102
+ );
1091
1103
  };
1092
1104
  var PlayerResultCard_default = PlayerResultCard;
1093
1105
  var TableResultCard = ({
@@ -1163,7 +1175,9 @@ var TableResultCard_default = TableResultCard;
1163
1175
  var EventResultCard = ({
1164
1176
  result,
1165
1177
  onClick,
1166
- tags
1178
+ tags,
1179
+ showEventTag,
1180
+ eventTagId
1167
1181
  }) => {
1168
1182
  const formatDate = (dateString) => {
1169
1183
  const options = {
@@ -1190,29 +1204,40 @@ var EventResultCard = ({
1190
1204
  }
1191
1205
  }
1192
1206
  );
1193
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: eventIcon, tags, children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1194
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1195
- /* @__PURE__ */ jsx(CalendarTodayIcon, { sx: { mr: 1, color: "primary.main" } }),
1196
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1197
- /* @__PURE__ */ jsx("strong", { children: "Date:" }),
1198
- " ",
1199
- formattedDate
1200
- ] })
1201
- ] }),
1202
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center" }, children: [
1203
- /* @__PURE__ */ jsx(LocationOnIcon, { sx: { mr: 1, color: "primary.main" } }),
1204
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1205
- /* @__PURE__ */ jsx("strong", { children: "Location:" }),
1206
- " ",
1207
- location
1207
+ return /* @__PURE__ */ jsx(
1208
+ BaseSearchResultCard_default,
1209
+ {
1210
+ result,
1211
+ onClick,
1212
+ icon: eventIcon,
1213
+ tags,
1214
+ showEventTag,
1215
+ eventTagId,
1216
+ children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1217
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1218
+ /* @__PURE__ */ jsx(CalendarTodayIcon, { sx: { mr: 1, color: "primary.main" } }),
1219
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1220
+ /* @__PURE__ */ jsx("strong", { children: "Date:" }),
1221
+ " ",
1222
+ formattedDate
1223
+ ] })
1224
+ ] }),
1225
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center" }, children: [
1226
+ /* @__PURE__ */ jsx(LocationOnIcon, { sx: { mr: 1, color: "primary.main" } }),
1227
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1228
+ /* @__PURE__ */ jsx("strong", { children: "Location:" }),
1229
+ " ",
1230
+ location
1231
+ ] })
1232
+ ] }),
1233
+ result.organizer && /* @__PURE__ */ jsxs(Typography4, { variant: "body2", sx: { mt: 1 }, children: [
1234
+ /* @__PURE__ */ jsx("strong", { children: "Organizer:" }),
1235
+ " ",
1236
+ result.organizer
1237
+ ] })
1208
1238
  ] })
1209
- ] }),
1210
- result.organizer && /* @__PURE__ */ jsxs(Typography4, { variant: "body2", sx: { mt: 1 }, children: [
1211
- /* @__PURE__ */ jsx("strong", { children: "Organizer:" }),
1212
- " ",
1213
- result.organizer
1214
- ] })
1215
- ] }) });
1239
+ }
1240
+ );
1216
1241
  };
1217
1242
  var EventResultCard_default = EventResultCard;
1218
1243
  var ResultsContainer = ({
@@ -1259,7 +1284,9 @@ var ResultsContainer = ({
1259
1284
  {
1260
1285
  result,
1261
1286
  onClick: onPlayerClick,
1262
- tags
1287
+ tags,
1288
+ showEventTag,
1289
+ eventTagId
1263
1290
  },
1264
1291
  result.id
1265
1292
  );
@@ -1281,7 +1308,9 @@ var ResultsContainer = ({
1281
1308
  {
1282
1309
  result,
1283
1310
  onClick: onEventClick,
1284
- tags
1311
+ tags,
1312
+ showEventTag,
1313
+ eventTagId
1285
1314
  },
1286
1315
  result.id
1287
1316
  );
@@ -1333,16 +1362,15 @@ var TablesScrollableList = ({
1333
1362
  eventTagId
1334
1363
  }) => {
1335
1364
  const tables = (results || []).filter((r) => (r == null ? void 0 : r.type) === "table");
1336
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
1337
1365
  return /* @__PURE__ */ jsx(
1338
1366
  ScrollableResultsList_default,
1339
1367
  {
1340
1368
  results: tables,
1341
1369
  tags,
1342
1370
  maxHeight,
1343
- onResultClick: (id, type) => {
1344
- if (type === "table") handleClick(id);
1345
- },
1371
+ onResultClick: onResultClick ? (id, type) => {
1372
+ if (type === "table") onResultClick(id);
1373
+ } : void 0,
1346
1374
  showEventTag,
1347
1375
  eventTagId
1348
1376
  }
@@ -1353,12 +1381,24 @@ var EventTablesCard = ({
1353
1381
  tables,
1354
1382
  tags,
1355
1383
  maxHeight = 450,
1356
- onTableClick
1384
+ onTableClick,
1385
+ showEventTag,
1386
+ eventTagId
1357
1387
  }) => {
1358
1388
  return /* @__PURE__ */ jsxs(Card10, { elevation: 6, sx: { width: "100%", boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.15)" }, children: [
1359
1389
  /* @__PURE__ */ jsx(CardHeader4, { title: "Tables" }),
1360
1390
  /* @__PURE__ */ jsx(Divider3, {}),
1361
- /* @__PURE__ */ jsx(CardContent10, { children: /* @__PURE__ */ jsx(TablesScrollableList_default, { results: tables, tags, maxHeight, onResultClick: onTableClick }) })
1391
+ /* @__PURE__ */ jsx(CardContent10, { children: /* @__PURE__ */ jsx(
1392
+ TablesScrollableList_default,
1393
+ {
1394
+ results: tables,
1395
+ tags,
1396
+ maxHeight,
1397
+ onResultClick: onTableClick,
1398
+ showEventTag,
1399
+ eventTagId
1400
+ }
1401
+ ) })
1362
1402
  ] });
1363
1403
  };
1364
1404
  var EventTablesCard_default = EventTablesCard;
@@ -1387,7 +1427,15 @@ function EventPageLayout({
1387
1427
  locationId: mergedEvent.location || "0"
1388
1428
  }
1389
1429
  ) }),
1390
- /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1430
+ /* @__PURE__ */ jsx(Grid10, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1431
+ EventTablesCard_default,
1432
+ {
1433
+ tables,
1434
+ tags: allTags,
1435
+ showEventTag: true,
1436
+ eventTagId: mergedEvent.id
1437
+ }
1438
+ ) })
1391
1439
  ] }),
1392
1440
  /* @__PURE__ */ jsx(Grid10, {})
1393
1441
  ] }) });
@@ -2344,16 +2392,15 @@ var PlayersScrollableList = ({
2344
2392
  onResultClick
2345
2393
  }) => {
2346
2394
  const players = (results || []).filter((r) => (r == null ? void 0 : r.type) === "player");
2347
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
2348
2395
  return /* @__PURE__ */ jsx(
2349
2396
  ScrollableResultsList_default,
2350
2397
  {
2351
2398
  results: players,
2352
2399
  tags,
2353
2400
  maxHeight,
2354
- onResultClick: (id, type) => {
2355
- if (type === "player") handleClick(id);
2356
- }
2401
+ onResultClick: onResultClick ? (id, type) => {
2402
+ if (type === "player") onResultClick(id);
2403
+ } : void 0
2357
2404
  }
2358
2405
  );
2359
2406
  };