@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.cjs CHANGED
@@ -1099,7 +1099,9 @@ var BaseSearchResultCard_default = BaseSearchResultCard;
1099
1099
  var PlayerResultCard = ({
1100
1100
  result,
1101
1101
  onClick,
1102
- tags
1102
+ tags,
1103
+ showEventTag,
1104
+ eventTagId
1103
1105
  }) => {
1104
1106
  const firstLetter = result.title.charAt(0).toUpperCase();
1105
1107
  const getAvatarColor = (name) => {
@@ -1141,7 +1143,17 @@ var PlayerResultCard = ({
1141
1143
  children: !result.imageUrl && firstLetter
1142
1144
  }
1143
1145
  );
1144
- return /* @__PURE__ */ jsxRuntime.jsx(BaseSearchResultCard_default, { result, onClick, icon: playerIcon, tags });
1146
+ return /* @__PURE__ */ jsxRuntime.jsx(
1147
+ BaseSearchResultCard_default,
1148
+ {
1149
+ result,
1150
+ onClick,
1151
+ icon: playerIcon,
1152
+ tags,
1153
+ showEventTag,
1154
+ eventTagId
1155
+ }
1156
+ );
1145
1157
  };
1146
1158
  var PlayerResultCard_default = PlayerResultCard;
1147
1159
  var TableResultCard = ({
@@ -1217,7 +1229,9 @@ var TableResultCard_default = TableResultCard;
1217
1229
  var EventResultCard = ({
1218
1230
  result,
1219
1231
  onClick,
1220
- tags
1232
+ tags,
1233
+ showEventTag,
1234
+ eventTagId
1221
1235
  }) => {
1222
1236
  const formatDate = (dateString) => {
1223
1237
  const options = {
@@ -1244,29 +1258,40 @@ var EventResultCard = ({
1244
1258
  }
1245
1259
  }
1246
1260
  );
1247
- return /* @__PURE__ */ jsxRuntime.jsx(BaseSearchResultCard_default, { result, onClick, icon: eventIcon, tags, children: /* @__PURE__ */ jsxRuntime.jsxs(Box2__default.default, { sx: { mb: 2 }, children: [
1248
- /* @__PURE__ */ jsxRuntime.jsxs(Box2__default.default, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1249
- /* @__PURE__ */ jsxRuntime.jsx(CalendarTodayIcon__default.default, { sx: { mr: 1, color: "primary.main" } }),
1250
- /* @__PURE__ */ jsxRuntime.jsxs(Typography4__default.default, { variant: "body2", children: [
1251
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Date:" }),
1252
- " ",
1253
- formattedDate
1254
- ] })
1255
- ] }),
1256
- /* @__PURE__ */ jsxRuntime.jsxs(Box2__default.default, { sx: { display: "flex", alignItems: "center" }, children: [
1257
- /* @__PURE__ */ jsxRuntime.jsx(LocationOnIcon__default.default, { sx: { mr: 1, color: "primary.main" } }),
1258
- /* @__PURE__ */ jsxRuntime.jsxs(Typography4__default.default, { variant: "body2", children: [
1259
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Location:" }),
1260
- " ",
1261
- location
1261
+ return /* @__PURE__ */ jsxRuntime.jsx(
1262
+ BaseSearchResultCard_default,
1263
+ {
1264
+ result,
1265
+ onClick,
1266
+ icon: eventIcon,
1267
+ tags,
1268
+ showEventTag,
1269
+ eventTagId,
1270
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Box2__default.default, { sx: { mb: 2 }, children: [
1271
+ /* @__PURE__ */ jsxRuntime.jsxs(Box2__default.default, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1272
+ /* @__PURE__ */ jsxRuntime.jsx(CalendarTodayIcon__default.default, { sx: { mr: 1, color: "primary.main" } }),
1273
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography4__default.default, { variant: "body2", children: [
1274
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Date:" }),
1275
+ " ",
1276
+ formattedDate
1277
+ ] })
1278
+ ] }),
1279
+ /* @__PURE__ */ jsxRuntime.jsxs(Box2__default.default, { sx: { display: "flex", alignItems: "center" }, children: [
1280
+ /* @__PURE__ */ jsxRuntime.jsx(LocationOnIcon__default.default, { sx: { mr: 1, color: "primary.main" } }),
1281
+ /* @__PURE__ */ jsxRuntime.jsxs(Typography4__default.default, { variant: "body2", children: [
1282
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Location:" }),
1283
+ " ",
1284
+ location
1285
+ ] })
1286
+ ] }),
1287
+ result.organizer && /* @__PURE__ */ jsxRuntime.jsxs(Typography4__default.default, { variant: "body2", sx: { mt: 1 }, children: [
1288
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Organizer:" }),
1289
+ " ",
1290
+ result.organizer
1291
+ ] })
1262
1292
  ] })
1263
- ] }),
1264
- result.organizer && /* @__PURE__ */ jsxRuntime.jsxs(Typography4__default.default, { variant: "body2", sx: { mt: 1 }, children: [
1265
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Organizer:" }),
1266
- " ",
1267
- result.organizer
1268
- ] })
1269
- ] }) });
1293
+ }
1294
+ );
1270
1295
  };
1271
1296
  var EventResultCard_default = EventResultCard;
1272
1297
  var ResultsContainer = ({
@@ -1313,7 +1338,9 @@ var ResultsContainer = ({
1313
1338
  {
1314
1339
  result,
1315
1340
  onClick: onPlayerClick,
1316
- tags
1341
+ tags,
1342
+ showEventTag,
1343
+ eventTagId
1317
1344
  },
1318
1345
  result.id
1319
1346
  );
@@ -1335,7 +1362,9 @@ var ResultsContainer = ({
1335
1362
  {
1336
1363
  result,
1337
1364
  onClick: onEventClick,
1338
- tags
1365
+ tags,
1366
+ showEventTag,
1367
+ eventTagId
1339
1368
  },
1340
1369
  result.id
1341
1370
  );
@@ -1387,16 +1416,15 @@ var TablesScrollableList = ({
1387
1416
  eventTagId
1388
1417
  }) => {
1389
1418
  const tables = (results || []).filter((r) => (r == null ? void 0 : r.type) === "table");
1390
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
1391
1419
  return /* @__PURE__ */ jsxRuntime.jsx(
1392
1420
  ScrollableResultsList_default,
1393
1421
  {
1394
1422
  results: tables,
1395
1423
  tags,
1396
1424
  maxHeight,
1397
- onResultClick: (id, type) => {
1398
- if (type === "table") handleClick(id);
1399
- },
1425
+ onResultClick: onResultClick ? (id, type) => {
1426
+ if (type === "table") onResultClick(id);
1427
+ } : void 0,
1400
1428
  showEventTag,
1401
1429
  eventTagId
1402
1430
  }
@@ -1407,12 +1435,24 @@ var EventTablesCard = ({
1407
1435
  tables,
1408
1436
  tags,
1409
1437
  maxHeight = 450,
1410
- onTableClick
1438
+ onTableClick,
1439
+ showEventTag,
1440
+ eventTagId
1411
1441
  }) => {
1412
1442
  return /* @__PURE__ */ jsxRuntime.jsxs(Card10__default.default, { elevation: 6, sx: { width: "100%", boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.15)" }, children: [
1413
1443
  /* @__PURE__ */ jsxRuntime.jsx(CardHeader4__default.default, { title: "Tables" }),
1414
1444
  /* @__PURE__ */ jsxRuntime.jsx(Divider3__default.default, {}),
1415
- /* @__PURE__ */ jsxRuntime.jsx(CardContent10__default.default, { children: /* @__PURE__ */ jsxRuntime.jsx(TablesScrollableList_default, { results: tables, tags, maxHeight, onResultClick: onTableClick }) })
1445
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent10__default.default, { children: /* @__PURE__ */ jsxRuntime.jsx(
1446
+ TablesScrollableList_default,
1447
+ {
1448
+ results: tables,
1449
+ tags,
1450
+ maxHeight,
1451
+ onResultClick: onTableClick,
1452
+ showEventTag,
1453
+ eventTagId
1454
+ }
1455
+ ) })
1416
1456
  ] });
1417
1457
  };
1418
1458
  var EventTablesCard_default = EventTablesCard;
@@ -1441,7 +1481,15 @@ function EventPageLayout({
1441
1481
  locationId: mergedEvent.location || "0"
1442
1482
  }
1443
1483
  ) }),
1444
- /* @__PURE__ */ jsxRuntime.jsx(Grid10__default.default, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsxRuntime.jsx(EventTablesCard_default, { tables, tags: allTags }) })
1484
+ /* @__PURE__ */ jsxRuntime.jsx(Grid10__default.default, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsxRuntime.jsx(
1485
+ EventTablesCard_default,
1486
+ {
1487
+ tables,
1488
+ tags: allTags,
1489
+ showEventTag: true,
1490
+ eventTagId: mergedEvent.id
1491
+ }
1492
+ ) })
1445
1493
  ] }),
1446
1494
  /* @__PURE__ */ jsxRuntime.jsx(Grid10__default.default, {})
1447
1495
  ] }) });
@@ -2398,16 +2446,15 @@ var PlayersScrollableList = ({
2398
2446
  onResultClick
2399
2447
  }) => {
2400
2448
  const players = (results || []).filter((r) => (r == null ? void 0 : r.type) === "player");
2401
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
2402
2449
  return /* @__PURE__ */ jsxRuntime.jsx(
2403
2450
  ScrollableResultsList_default,
2404
2451
  {
2405
2452
  results: players,
2406
2453
  tags,
2407
2454
  maxHeight,
2408
- onResultClick: (id, type) => {
2409
- if (type === "player") handleClick(id);
2410
- }
2455
+ onResultClick: onResultClick ? (id, type) => {
2456
+ if (type === "player") onResultClick(id);
2457
+ } : void 0
2411
2458
  }
2412
2459
  );
2413
2460
  };