@local-civics/mgmt-ui 0.1.188 → 0.1.189

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
@@ -1092,7 +1092,7 @@ function Table$b(props) {
1092
1092
  confirmProps: { color: "red" },
1093
1093
  onConfirm: () => props.onDelete && props.onDelete(student)
1094
1094
  });
1095
- const rows = props.items.map((row) => /* @__PURE__ */ React.createElement("tr", { key: row.email }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Group, { spacing: "sm" }, /* @__PURE__ */ React.createElement(Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, row.givenName && row.familyName ? `${row.givenName} ${row.familyName}` : row.email), /* @__PURE__ */ React.createElement(Text, { size: "xs", color: "dimmed" }, row.email))))), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Box, { maw: 150 }, /* @__PURE__ */ React.createElement(
1095
+ const rows = sortedItems.map((row) => /* @__PURE__ */ React.createElement("tr", { key: row.email }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Group, { spacing: "sm" }, /* @__PURE__ */ React.createElement(Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, row.givenName && row.familyName ? `${row.givenName} ${row.familyName}` : row.email), /* @__PURE__ */ React.createElement(Text, { size: "xs", color: "dimmed" }, row.email))))), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Box, { maw: 150 }, /* @__PURE__ */ React.createElement(
1096
1096
  Select,
1097
1097
  {
1098
1098
  size: "sm",
@@ -3407,9 +3407,17 @@ var __spreadValues = (a, b) => {
3407
3407
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3408
3408
  function Table$1(props) {
3409
3409
  const preparedItems = React.useMemo(() => {
3410
- return props.items.map((item) => __spreadValues(__spreadProps(__spreadValues({}, item), {
3411
- status: item.isComplete
3412
- }), item.categoryPoints));
3410
+ return props.items.map((item) => {
3411
+ const flatItem = __spreadProps(__spreadValues({}, item), {
3412
+ status: item.isComplete ? 1 : 0
3413
+ });
3414
+ if (item.categoryPoints) {
3415
+ Object.keys(item.categoryPoints).forEach((catId) => {
3416
+ flatItem[catId] = item.categoryPoints[catId];
3417
+ });
3418
+ }
3419
+ return flatItem;
3420
+ });
3413
3421
  }, [props.items]);
3414
3422
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3415
3423
  if (props.items.length === 0) {
@@ -3462,8 +3470,8 @@ function Table$1(props) {
3462
3470
  sortable: true,
3463
3471
  titleStyle: { whiteSpace: "nowrap" },
3464
3472
  render: (row) => {
3465
- var _a, _b;
3466
- return /* @__PURE__ */ React.createElement(Badge$1, { color: "blue", variant: "filled" }, (_b = (_a = row.categoryPoints) == null ? void 0 : _a[category.categoryId]) != null ? _b : 0, " pts");
3473
+ var _a;
3474
+ return /* @__PURE__ */ React.createElement(Badge$1, { color: "blue", variant: "filled" }, (_a = row[category.categoryId]) != null ? _a : 0, " pts");
3467
3475
  }
3468
3476
  }))
3469
3477
  ],