@local-civics/mgmt-ui 0.1.254 → 0.1.256

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.d.ts CHANGED
@@ -1048,6 +1048,7 @@ type SubmissionComment = {
1048
1048
  createdAt: string;
1049
1049
  isLocal?: boolean;
1050
1050
  needsSubmission?: boolean;
1051
+ targetLabel?: string;
1051
1052
  };
1052
1053
  /**
1053
1054
  * SubmissionCommentPanelProps
package/dist/index.js CHANGED
@@ -4077,8 +4077,8 @@ const CommentCenter = (props) => {
4077
4077
  const groupUserIds = Array.from(new Set(group.items.map((gi) => gi.recipientId)));
4078
4078
  const onTitleClick = tab === "students" ? props.onStudentClick ? () => props.onStudentClick(group.key, { badgeId: void 0, lessonId: void 0, groupUserIds }) : void 0 : tab === "badges" ? props.onBadgeClick ? () => props.onBadgeClick(group.key) : void 0 : props.onLessonClick ? () => props.onLessonClick(group.key) : void 0;
4079
4079
  return /* @__PURE__ */ React__namespace.createElement("div", { key: group.key, className: "overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2.5 border-b border-slate-100 bg-slate-50/60 px-5 py-2.5" }, tab === "students" ? /* @__PURE__ */ React__namespace.createElement("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-mint-400/20 text-[10px] font-bold text-dark-blue-400" }, (group.title[0] || "?").toUpperCase()) : tab === "badges" ? /* @__PURE__ */ React__namespace.createElement("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-mint-400/15" }, /* @__PURE__ */ React__namespace.createElement(icons.IconAlbum, { size: 15, stroke: 2, className: "text-mint-400" })) : /* @__PURE__ */ React__namespace.createElement("div", { className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-gold-400/15" }, /* @__PURE__ */ React__namespace.createElement(icons.IconLambda, { size: 15, stroke: 2, className: "text-gold-400" })), onTitleClick ? /* @__PURE__ */ React__namespace.createElement("button", { type: "button", onClick: onTitleClick, className: "text-left text-xs font-extrabold text-sky-blue-400 hover:underline" }, group.title) : /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-extrabold text-dark-blue-400" }, group.title)), group.items.map((item, i) => {
4080
- const materialName = tab === "students" ? item.badgeName || item.lessonName || "General" : item.recipientName;
4081
- const materialType = tab === "students" ? item.badgeId ? "Badge" : item.lessonId ? "Lesson" : void 0 : void 0;
4080
+ const materialName = tab === "students" ? item.lessonName || item.badgeName || "General" : item.recipientName;
4081
+ const materialType = tab === "students" ? item.lessonId ? "Lesson" : item.badgeId ? "Badge" : void 0 : void 0;
4082
4082
  return /* @__PURE__ */ React__namespace.createElement(
4083
4083
  "div",
4084
4084
  {
@@ -4102,7 +4102,7 @@ const CommentCenter = (props) => {
4102
4102
  /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate text-[11px] text-slate-500" }, item.commenterName || "\u2014"),
4103
4103
  /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs text-slate-600" }, item.commentText),
4104
4104
  /* @__PURE__ */ React__namespace.createElement("div", { className: "truncate text-[11px] text-slate-400" }, formatDate$1(item.createdAt)),
4105
- /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-center" }, item.requireValidation && /* @__PURE__ */ React__namespace.createElement("span", { className: "rounded-full bg-gold-400/15 px-2 py-0.5 text-[10px] font-bold text-dark-blue-400" }, "Requires validation")),
4105
+ /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-center" }, item.requireValidation && /* @__PURE__ */ React__namespace.createElement("span", { className: `rounded-full px-2 py-0.5 text-[10px] font-bold text-dark-blue-400 ${item.resolvedAt ? "bg-mint-400/15" : "bg-gold-400/15"}` }, item.resolvedAt ? "Resolved" : "Needs validation")),
4106
4106
  /* @__PURE__ */ React__namespace.createElement("div", { className: "flex justify-center" }, !item.requireValidation ? /* @__PURE__ */ React__namespace.createElement("span", { className: "text-[11px] text-slate-400" }, "\u2014") : item.resolvedAt ? /* @__PURE__ */ React__namespace.createElement(icons.IconCheck, { size: 16, stroke: 3, className: "text-mint-400" }) : item.isLocal ? /* @__PURE__ */ React__namespace.createElement("span", { className: "text-[11px] text-slate-400" }, "Pending") : /* @__PURE__ */ React__namespace.createElement(
4107
4107
  "button",
4108
4108
  {
@@ -4257,7 +4257,7 @@ function SubmissionCommentPanel(props) {
4257
4257
  "Leave a Comment"
4258
4258
  ))), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-4 flex flex-col gap-3" }, props.loading && /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-slate-400" }, "Loading comments\u2026"), !props.loading && props.comments.length === 0 && /* @__PURE__ */ React__namespace.createElement("p", { className: "text-sm text-slate-400" }, "No comments yet."), !props.loading && props.comments.map((c) => {
4259
4259
  const resolved = !!c.resolvedAt;
4260
- return /* @__PURE__ */ React__namespace.createElement("div", { key: c.commentId, className: "rounded-lg border border-slate-100 bg-slate-50 p-3.5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold text-dark-blue-400" }, c.commenterName || "Educator"), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-[10.5px] text-slate-400" }, formatDate(c.createdAt))), /* @__PURE__ */ React__namespace.createElement("p", { className: "mt-1.5 text-sm text-slate-600" }, c.commentText), c.requireValidation && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2.5 flex items-center gap-2" }, /* @__PURE__ */ React__namespace.createElement("span", { className: `rounded-full px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide ${!resolved ? "bg-gold-100 text-dark-blue-400" : c.needsSubmission ? "bg-sky-blue-400/15 text-dark-blue-400" : "bg-mint-100 text-dark-blue-400"}` }, !resolved ? "Needs Validation" : c.needsSubmission ? "Needs Submission" : "Resolved"), !resolved && !c.isLocal && props.onResolve && /* @__PURE__ */ React__namespace.createElement(
4260
+ return /* @__PURE__ */ React__namespace.createElement("div", { key: c.commentId, className: "rounded-lg border border-slate-100 bg-slate-50 p-3.5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-bold text-dark-blue-400" }, c.commenterName || "Educator"), /* @__PURE__ */ React__namespace.createElement("div", { className: "text-[10.5px] text-slate-400" }, formatDate(c.createdAt))), c.targetLabel && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1 text-[11px] font-bold text-slate-400" }, c.targetLabel), /* @__PURE__ */ React__namespace.createElement("p", { className: "mt-1.5 text-sm text-slate-600" }, c.commentText), c.requireValidation && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-2.5 flex items-center gap-2" }, /* @__PURE__ */ React__namespace.createElement("span", { className: `rounded-full px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide ${!resolved ? "bg-gold-100 text-dark-blue-400" : c.needsSubmission ? "bg-sky-blue-400/15 text-dark-blue-400" : "bg-mint-100 text-dark-blue-400"}` }, !resolved ? "Needs validation" : c.needsSubmission ? "Needs submission" : "Resolved"), !resolved && !c.isLocal && props.onResolve && /* @__PURE__ */ React__namespace.createElement(
4261
4261
  "button",
4262
4262
  {
4263
4263
  type: "button",