@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.
@@ -33,6 +33,8 @@ interface EventTablesCardProps {
33
33
  tags: Tag[];
34
34
  maxHeight?: number | string;
35
35
  onTableClick?: (id: number) => void;
36
+ showEventTag?: boolean;
37
+ eventTagId?: number;
36
38
  }
37
39
  /**
38
40
  * Event page card that shows a scrollable list of tables, reusing search result cards.
@@ -33,6 +33,8 @@ interface EventTablesCardProps {
33
33
  tags: Tag[];
34
34
  maxHeight?: number | string;
35
35
  onTableClick?: (id: number) => void;
36
+ showEventTag?: boolean;
37
+ eventTagId?: number;
36
38
  }
37
39
  /**
38
40
  * Event page card that shows a scrollable list of tables, reusing search result cards.
@@ -1018,7 +1018,9 @@ var BaseSearchResultCard_default = BaseSearchResultCard;
1018
1018
  var PlayerResultCard = ({
1019
1019
  result,
1020
1020
  onClick,
1021
- tags
1021
+ tags,
1022
+ showEventTag,
1023
+ eventTagId
1022
1024
  }) => {
1023
1025
  const firstLetter = result.title.charAt(0).toUpperCase();
1024
1026
  const getAvatarColor = (name) => {
@@ -1060,7 +1062,17 @@ var PlayerResultCard = ({
1060
1062
  children: !result.imageUrl && firstLetter
1061
1063
  }
1062
1064
  );
1063
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: playerIcon, tags });
1065
+ return /* @__PURE__ */ jsx(
1066
+ BaseSearchResultCard_default,
1067
+ {
1068
+ result,
1069
+ onClick,
1070
+ icon: playerIcon,
1071
+ tags,
1072
+ showEventTag,
1073
+ eventTagId
1074
+ }
1075
+ );
1064
1076
  };
1065
1077
  var PlayerResultCard_default = PlayerResultCard;
1066
1078
  var TableResultCard = ({
@@ -1136,7 +1148,9 @@ var TableResultCard_default = TableResultCard;
1136
1148
  var EventResultCard = ({
1137
1149
  result,
1138
1150
  onClick,
1139
- tags
1151
+ tags,
1152
+ showEventTag,
1153
+ eventTagId
1140
1154
  }) => {
1141
1155
  const formatDate = (dateString) => {
1142
1156
  const options = {
@@ -1163,29 +1177,40 @@ var EventResultCard = ({
1163
1177
  }
1164
1178
  }
1165
1179
  );
1166
- return /* @__PURE__ */ jsx(BaseSearchResultCard_default, { result, onClick, icon: eventIcon, tags, children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1167
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1168
- /* @__PURE__ */ jsx(CalendarTodayIcon, { sx: { mr: 1, color: "primary.main" } }),
1169
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1170
- /* @__PURE__ */ jsx("strong", { children: "Date:" }),
1171
- " ",
1172
- formattedDate
1173
- ] })
1174
- ] }),
1175
- /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center" }, children: [
1176
- /* @__PURE__ */ jsx(LocationOnIcon, { sx: { mr: 1, color: "primary.main" } }),
1177
- /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1178
- /* @__PURE__ */ jsx("strong", { children: "Location:" }),
1179
- " ",
1180
- location
1180
+ return /* @__PURE__ */ jsx(
1181
+ BaseSearchResultCard_default,
1182
+ {
1183
+ result,
1184
+ onClick,
1185
+ icon: eventIcon,
1186
+ tags,
1187
+ showEventTag,
1188
+ eventTagId,
1189
+ children: /* @__PURE__ */ jsxs(Box2, { sx: { mb: 2 }, children: [
1190
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", mb: 1 }, children: [
1191
+ /* @__PURE__ */ jsx(CalendarTodayIcon, { sx: { mr: 1, color: "primary.main" } }),
1192
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1193
+ /* @__PURE__ */ jsx("strong", { children: "Date:" }),
1194
+ " ",
1195
+ formattedDate
1196
+ ] })
1197
+ ] }),
1198
+ /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center" }, children: [
1199
+ /* @__PURE__ */ jsx(LocationOnIcon, { sx: { mr: 1, color: "primary.main" } }),
1200
+ /* @__PURE__ */ jsxs(Typography4, { variant: "body2", children: [
1201
+ /* @__PURE__ */ jsx("strong", { children: "Location:" }),
1202
+ " ",
1203
+ location
1204
+ ] })
1205
+ ] }),
1206
+ result.organizer && /* @__PURE__ */ jsxs(Typography4, { variant: "body2", sx: { mt: 1 }, children: [
1207
+ /* @__PURE__ */ jsx("strong", { children: "Organizer:" }),
1208
+ " ",
1209
+ result.organizer
1210
+ ] })
1181
1211
  ] })
1182
- ] }),
1183
- result.organizer && /* @__PURE__ */ jsxs(Typography4, { variant: "body2", sx: { mt: 1 }, children: [
1184
- /* @__PURE__ */ jsx("strong", { children: "Organizer:" }),
1185
- " ",
1186
- result.organizer
1187
- ] })
1188
- ] }) });
1212
+ }
1213
+ );
1189
1214
  };
1190
1215
  var EventResultCard_default = EventResultCard;
1191
1216
  var ResultsContainer = ({
@@ -1232,7 +1257,9 @@ var ResultsContainer = ({
1232
1257
  {
1233
1258
  result,
1234
1259
  onClick: onPlayerClick,
1235
- tags
1260
+ tags,
1261
+ showEventTag,
1262
+ eventTagId
1236
1263
  },
1237
1264
  result.id
1238
1265
  );
@@ -1254,7 +1281,9 @@ var ResultsContainer = ({
1254
1281
  {
1255
1282
  result,
1256
1283
  onClick: onEventClick,
1257
- tags
1284
+ tags,
1285
+ showEventTag,
1286
+ eventTagId
1258
1287
  },
1259
1288
  result.id
1260
1289
  );
@@ -1306,16 +1335,15 @@ var TablesScrollableList = ({
1306
1335
  eventTagId
1307
1336
  }) => {
1308
1337
  const tables = (results || []).filter((r) => (r == null ? void 0 : r.type) === "table");
1309
- const handleClick = (id) => onResultClick == null ? void 0 : onResultClick(id);
1310
1338
  return /* @__PURE__ */ jsx(
1311
1339
  ScrollableResultsList_default,
1312
1340
  {
1313
1341
  results: tables,
1314
1342
  tags,
1315
1343
  maxHeight,
1316
- onResultClick: (id, type) => {
1317
- if (type === "table") handleClick(id);
1318
- },
1344
+ onResultClick: onResultClick ? (id, type) => {
1345
+ if (type === "table") onResultClick(id);
1346
+ } : void 0,
1319
1347
  showEventTag,
1320
1348
  eventTagId
1321
1349
  }
@@ -1326,12 +1354,24 @@ var EventTablesCard = ({
1326
1354
  tables,
1327
1355
  tags,
1328
1356
  maxHeight = 450,
1329
- onTableClick
1357
+ onTableClick,
1358
+ showEventTag,
1359
+ eventTagId
1330
1360
  }) => {
1331
1361
  return /* @__PURE__ */ jsxs(Card3, { elevation: 6, sx: { width: "100%", boxShadow: "0px 8px 24px rgba(0, 0, 0, 0.15)" }, children: [
1332
1362
  /* @__PURE__ */ jsx(CardHeader, { title: "Tables" }),
1333
1363
  /* @__PURE__ */ jsx(Divider, {}),
1334
- /* @__PURE__ */ jsx(CardContent3, { children: /* @__PURE__ */ jsx(TablesScrollableList_default, { results: tables, tags, maxHeight, onResultClick: onTableClick }) })
1364
+ /* @__PURE__ */ jsx(CardContent3, { children: /* @__PURE__ */ jsx(
1365
+ TablesScrollableList_default,
1366
+ {
1367
+ results: tables,
1368
+ tags,
1369
+ maxHeight,
1370
+ onResultClick: onTableClick,
1371
+ showEventTag,
1372
+ eventTagId
1373
+ }
1374
+ ) })
1335
1375
  ] });
1336
1376
  };
1337
1377
  var EventTablesCard_default = EventTablesCard;
@@ -1360,7 +1400,15 @@ function EventPageLayout({
1360
1400
  locationId: mergedEvent.location || "0"
1361
1401
  }
1362
1402
  ) }),
1363
- /* @__PURE__ */ jsx(Grid5, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1403
+ /* @__PURE__ */ jsx(Grid5, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1404
+ EventTablesCard_default,
1405
+ {
1406
+ tables,
1407
+ tags: allTags,
1408
+ showEventTag: true,
1409
+ eventTagId: mergedEvent.id
1410
+ }
1411
+ ) })
1364
1412
  ] }),
1365
1413
  /* @__PURE__ */ jsx(Grid5, {})
1366
1414
  ] }) });