@nualang/nualang-ui-components 0.1.1306 → 0.1.1308

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.
@@ -1,12 +1,11 @@
1
1
  import { useMemo } from "react";
2
2
  import Typography from "@mui/material/Typography";
3
- import { Card, CardContent, Grid, Box, Divider, Button, LinearProgress, IconButton, Tooltip } from "@mui/material";
3
+ import { Card, CardContent, Grid, Box, Divider, Button, IconButton, Tooltip } from "@mui/material";
4
4
  import PropTypes from "prop-types";
5
5
  import AssignmentExerciseSelector from "../AssignmentExerciseSelector/AssignmentExerciseSelector";
6
6
  import { courses as courseQuerys, ReactQuery } from "@nualang/nualang-api-and-queries/Queries";
7
7
  import useConfirm from "../../hooks/useConfirm";
8
- import { Delete } from "@mui/icons-material";
9
- import { Edit } from "@mui/icons-material";
8
+ import { Delete, Edit } from "@mui/icons-material";
10
9
  import dayjs from "dayjs";
11
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
11
  export default function AssignmentCard({
@@ -41,6 +40,43 @@ export default function AssignmentCard({
41
40
  await deleteAssignment(classroomId, assignmentId);
42
41
  }
43
42
  };
43
+
44
+ // 🧠 Helper to format due or available text (adapted from MeetingPromptsList)
45
+ const formatAssignmentDueText = (availableDate, dueDate, t) => {
46
+ const now = dayjs();
47
+ const available = dayjs(availableDate);
48
+ const due = dayjs(dueDate);
49
+ const formattedDue = due.format("D MMM YYYY • h:mm A");
50
+ const formattedAvailable = available.format("D MMM YYYY • h:mm A");
51
+
52
+ // Case 1: Not yet available
53
+ if (available.isAfter(now)) {
54
+ const diffDays = available.startOf("day").diff(now.startOf("day"), "day");
55
+ let availableText = "";
56
+ if (diffDays === 0) {
57
+ availableText = t("available_today");
58
+ } else if (diffDays === 1) {
59
+ availableText = t("available_tomorrow");
60
+ } else {
61
+ availableText = `${t("available_in")} ${diffDays} ${t("days")}`;
62
+ }
63
+ return `${availableText} - ${formattedAvailable}`;
64
+ }
65
+
66
+ // Case 2: Available, now check due
67
+ const diffDays = due.startOf("day").diff(now.startOf("day"), "day");
68
+ let dueText = "";
69
+ if (diffDays < 0) {
70
+ dueText = t("past_due");
71
+ } else if (diffDays === 0) {
72
+ dueText = t("due_today");
73
+ } else if (diffDays === 1) {
74
+ dueText = t("due_tomorrow");
75
+ } else {
76
+ dueText = `${t("due_in")} ${diffDays} ${t("days")}`;
77
+ }
78
+ return `${dueText} - ${formattedDue}`;
79
+ };
44
80
  const {
45
81
  uniqueCourses
46
82
  } = useMemo(() => {
@@ -107,7 +143,10 @@ export default function AssignmentCard({
107
143
  alignItems: "center",
108
144
  children: [/*#__PURE__*/_jsx(Typography, {
109
145
  variant: "body1",
110
- component: "div",
146
+ fontWeight: 600,
147
+ sx: {
148
+ color: "text.primary"
149
+ },
111
150
  children: assignment.title
112
151
  }), isNew && /*#__PURE__*/_jsx(Box, {
113
152
  ml: 2,
@@ -126,7 +165,7 @@ export default function AssignmentCard({
126
165
  children: /*#__PURE__*/_jsx(Typography, {
127
166
  variant: "button",
128
167
  color: "text.secondary",
129
- children: dayjs(assignment.scheduleDate).isAfter(dayjs()) ? `${t("available_from")} ${dayjs(assignment.scheduleDate).format("DD MMM YYYY • h:mm A")}` : `${t("due")} ${dayjs(assignment.dueDate).format("DD MMM YYYY • h:mm A")}`
168
+ children: formatAssignmentDueText(assignment.scheduleDate, assignment.dueDate, t)
130
169
  })
131
170
  }), isCreator && /*#__PURE__*/_jsxs(Grid, {
132
171
  children: [/*#__PURE__*/_jsx(Tooltip, {
@@ -151,7 +190,8 @@ export default function AssignmentCard({
151
190
  mt: 2,
152
191
  children: [/*#__PURE__*/_jsx(Divider, {
153
192
  sx: {
154
- marginBottom: 1.5
193
+ marginBottom: "12px",
194
+ marginTop: "12px"
155
195
  }
156
196
  }), /*#__PURE__*/_jsxs(Grid, {
157
197
  container: true,
@@ -1,6 +1,6 @@
1
1
  import React, { useState, useEffect } from "react";
2
2
  import PropTypes from "prop-types";
3
- import { Typography, Box, IconButton, Tooltip, Button, Skeleton } from "@mui/material";
3
+ import { Typography, Box, IconButton, Tooltip, Button, Skeleton, Select, MenuItem, FormControl, InputLabel } from "@mui/material";
4
4
  import AssignmentCard from "../AssignmentCard/AssignmentCard";
5
5
  import Refresh from "@mui/icons-material/Refresh";
6
6
  import TeacherCreate from "../../img/teacher-create-2.svg";
@@ -31,6 +31,8 @@ const AssignmentCardsList = ({
31
31
  isChallengeModeStudent
32
32
  }) => {
33
33
  const [lastClickedExerciseId, setLastClickedExerciseId] = useState(null);
34
+ const [filter, setFilter] = useState("all"); // Filter state
35
+
34
36
  useEffect(() => {
35
37
  const stored = localStorage.getItem("lastClickedExercise");
36
38
  if (stored) {
@@ -44,6 +46,38 @@ const AssignmentCardsList = ({
44
46
  }
45
47
  }
46
48
  }, []);
49
+ const now = new Date();
50
+ const filteredAssignments = assignments.filter(assignment => {
51
+ if (!isCreator) {
52
+ if (Array.isArray(assignment.assignedStudents) && !assignment.assignedStudents.includes(memberId)) {
53
+ return false;
54
+ }
55
+ if (assignment.scheduleDate && new Date(assignment.scheduleDate) > now) {
56
+ return false;
57
+ }
58
+ }
59
+ return true;
60
+ }).filter(assignment => {
61
+ if (filter === "all") return true;
62
+ if (filter === "scheduled") {
63
+ return assignment.scheduleDate && new Date(assignment.scheduleDate) > now;
64
+ }
65
+ if (filter === "pastDue") {
66
+ return assignment.dueDate && new Date(assignment.dueDate) < now;
67
+ }
68
+ if (filter === "dueNext") {
69
+ return assignment.dueDate && new Date(assignment.dueDate) >= now;
70
+ }
71
+ return true;
72
+ }).sort((a, b) => {
73
+ if (filter === "dueNext") {
74
+ return new Date(a.dueDate) - new Date(b.dueDate);
75
+ }
76
+ if (filter === "scheduled") {
77
+ return new Date(a.scheduleDate) - new Date(b.scheduleDate);
78
+ }
79
+ return new Date(b.createdAt) - new Date(a.createdAt);
80
+ });
47
81
  if (isLoadingAssignments) {
48
82
  return /*#__PURE__*/_jsxs(Box, {
49
83
  mb: 1,
@@ -216,14 +250,39 @@ const AssignmentCardsList = ({
216
250
  mb: 1,
217
251
  children: [/*#__PURE__*/_jsxs(Box, {
218
252
  display: "flex",
219
- justifyContent: "space-between",
253
+ justifyContent: isCreator ? "space-between" : "flex-end",
220
254
  alignItems: "center",
221
255
  sx: {
222
- mb: 2
256
+ mb: 3,
257
+ mt: "8px"
223
258
  },
224
- children: [/*#__PURE__*/_jsx(Typography, {
225
- variant: "h5",
226
- children: t("assignments")
259
+ children: [isCreator && /*#__PURE__*/_jsxs(FormControl, {
260
+ size: "large",
261
+ sx: {
262
+ minWidth: 140,
263
+ marginTop: 1
264
+ },
265
+ children: [/*#__PURE__*/_jsx(InputLabel, {
266
+ children: t("view")
267
+ }), /*#__PURE__*/_jsxs(Select, {
268
+ value: filter,
269
+ onChange: e => setFilter(e.target.value),
270
+ label: t("view"),
271
+ autoWidth: true,
272
+ children: [/*#__PURE__*/_jsx(MenuItem, {
273
+ value: "all",
274
+ children: t("all")
275
+ }), /*#__PURE__*/_jsx(MenuItem, {
276
+ value: "dueNext",
277
+ children: t("due_next")
278
+ }), /*#__PURE__*/_jsx(MenuItem, {
279
+ value: "pastDue",
280
+ children: t("past_due")
281
+ }), /*#__PURE__*/_jsx(MenuItem, {
282
+ value: "scheduled",
283
+ children: t("scheduled")
284
+ })]
285
+ })]
227
286
  }), /*#__PURE__*/_jsx(Tooltip, {
228
287
  placement: "left",
229
288
  title: t("refresh_assignments"),
@@ -231,17 +290,15 @@ const AssignmentCardsList = ({
231
290
  onClick: refreshAssignments,
232
291
  "aria-label": "refresh",
233
292
  size: "large",
234
- children: /*#__PURE__*/_jsx(Refresh, {})
293
+ sx: {
294
+ size: "large"
295
+ },
296
+ children: /*#__PURE__*/_jsx(Refresh, {
297
+ fontSize: "inherit"
298
+ })
235
299
  })
236
300
  })]
237
- }), assignments.filter(assignment => {
238
- if (isCreator) return true;
239
- if (Array.isArray(assignment.assignedStudents) && !assignment.assignedStudents.includes(memberId)) {
240
- return false;
241
- }
242
- if (!assignment.scheduleDate) return true;
243
- return new Date(assignment.scheduleDate) <= new Date();
244
- }).sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt)).map((assignment, index) => /*#__PURE__*/_jsx(AssignmentCard, {
301
+ }), filteredAssignments.map((assignment, index) => /*#__PURE__*/_jsx(AssignmentCard, {
245
302
  index: index,
246
303
  lastAssignmentFetch: lastAssignmentFetch,
247
304
  assignment: assignment,
@@ -565,7 +565,18 @@ export default function CreateAssignmentDialog({
565
565
  sx: {
566
566
  width: "45%"
567
567
  },
568
- format: "DD MMM YYYY HH:mm"
568
+ format: "DD MMM YYYY HH:mm",
569
+ slotProps: {
570
+ popper: {
571
+ placement: "left-start",
572
+ modifiers: [{
573
+ name: "preventOverflow",
574
+ options: {
575
+ boundary: "viewport"
576
+ }
577
+ }]
578
+ }
579
+ }
569
580
  })
570
581
  }), /*#__PURE__*/_jsx(Typography, {
571
582
  variant: "h4",
@@ -585,7 +596,18 @@ export default function CreateAssignmentDialog({
585
596
  sx: {
586
597
  width: "45%"
587
598
  },
588
- format: "DD MMM YYYY HH:mm"
599
+ format: "DD MMM YYYY HH:mm",
600
+ slotProps: {
601
+ popper: {
602
+ placement: "left-start",
603
+ modifiers: [{
604
+ name: "preventOverflow",
605
+ options: {
606
+ boundary: "viewport"
607
+ }
608
+ }]
609
+ }
610
+ }
589
611
  })
590
612
  })]
591
613
  })]
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useRef } from "react";
2
- import { Card, CardContent, CardActions, Typography, Avatar, Box, Button, TextField, Chip, Grid } from "@mui/material";
2
+ import { Card, CardContent, CardActions, Typography, Avatar, Box, Button, TextField, Chip, Grid, IconButton, Tooltip } from "@mui/material";
3
3
  import { grey, green } from "@mui/material/colors";
4
4
  import AutoFixHighIcon from "@mui/icons-material/AutoFixHigh";
5
5
  import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
@@ -7,6 +7,12 @@ import CheckCircleIcon from "@mui/icons-material/CheckCircle";
7
7
  import { Formik } from "formik";
8
8
  import * as Yup from "yup";
9
9
  import RecordingDialog from "../../Dialogs/RecordingDialog/RecordingDialog";
10
+ import PDFViewer from "../../Dialogs/PDFViewer/PDFViewer";
11
+ import level1Rubric from '../../Dialogs/PDFViewer/rubrics/level1Rubric.pdf';
12
+ import level2Rubric from '../../Dialogs/PDFViewer/rubrics/level2Rubric.pdf';
13
+ import level3Rubric from '../../Dialogs/PDFViewer/rubrics/level3Rubric.pdf';
14
+ import level4Rubric from '../../Dialogs/PDFViewer/rubrics/level4Rubric.pdf';
15
+ import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
10
16
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
11
17
  export default function FeedbackCard({
12
18
  t = x => x,
@@ -27,6 +33,16 @@ export default function FeedbackCard({
27
33
  const [aiJustGenerated, setAiJustGenerated] = useState(false);
28
34
  const formikRef = useRef(null);
29
35
  const initialValuesRef = useRef(null);
36
+ const [openPDF, setOpenPDF] = useState(false);
37
+ const [pageNumber, setPageNumber] = useState(1);
38
+ const [scale, setScale] = useState(1);
39
+ const rubricMap = {
40
+ 1: level1Rubric,
41
+ 2: level2Rubric,
42
+ 3: level3Rubric,
43
+ 4: level4Rubric
44
+ };
45
+ const pdfUrl = rubricMap[discussionData?.level] || level1Rubric;
30
46
  const selectedMembers = userData.filter(u => [discussionData?.meetingMembers || discussionData?.userIds].flat().includes(u?.memberId));
31
47
  const joinedMembers = discussionData?.joinedMembers || [];
32
48
  let attendedMembers = [];
@@ -105,6 +121,12 @@ export default function FeedbackCard({
105
121
  setAiJustGenerated(true);
106
122
  await onGenerateFeedback(discussionData);
107
123
  };
124
+ const handleOpenPDF = () => {
125
+ setOpenPDF(true);
126
+ };
127
+ const handleClosePDF = () => {
128
+ setOpenPDF(false);
129
+ };
108
130
  return /*#__PURE__*/_jsxs(_Fragment, {
109
131
  children: [/*#__PURE__*/_jsx(Formik, {
110
132
  innerRef: formikRef,
@@ -196,9 +218,24 @@ export default function FeedbackCard({
196
218
  xs: 12,
197
219
  md: 9.5
198
220
  },
199
- children: /*#__PURE__*/_jsx(Typography, {
200
- variant: "subtitle2",
201
- children: t("feedback")
221
+ children: /*#__PURE__*/_jsxs(Box, {
222
+ sx: {
223
+ display: "flex",
224
+ alignItems: "center"
225
+ },
226
+ children: [/*#__PURE__*/_jsx(Typography, {
227
+ variant: "subtitle2",
228
+ children: t("feedback")
229
+ }), /*#__PURE__*/_jsx(Tooltip, {
230
+ title: t("rubric_info_desc"),
231
+ children: /*#__PURE__*/_jsx(IconButton, {
232
+ onClick: handleOpenPDF,
233
+ color: "primary",
234
+ "aria-label": t("rubric_info"),
235
+ size: "small",
236
+ children: /*#__PURE__*/_jsx(HelpOutlineIcon, {})
237
+ })
238
+ })]
202
239
  })
203
240
  })]
204
241
  })
@@ -349,6 +386,15 @@ export default function FeedbackCard({
349
386
  },
350
387
  aiGrade: aiGrade,
351
388
  hasBadLanguage: discussionData?.hasBadLanguage || false
389
+ }), /*#__PURE__*/_jsx(PDFViewer, {
390
+ open: openPDF,
391
+ handleClose: handleClosePDF,
392
+ pdfUrl: pdfUrl,
393
+ pageNumber: pageNumber,
394
+ setPageNumber: setPageNumber,
395
+ scale: scale,
396
+ setScale: setScale,
397
+ t: t
352
398
  })]
353
399
  });
354
400
  }
@@ -81,6 +81,7 @@ export default function ScheduleCard({
81
81
  gap: 2
82
82
  },
83
83
  children: /*#__PURE__*/_jsxs(Box, {
84
+ width: "100%",
84
85
  children: [/*#__PURE__*/_jsxs(Box, {
85
86
  sx: {
86
87
  display: "flex",
@@ -119,14 +120,28 @@ export default function ScheduleCard({
119
120
  },
120
121
  children: teacherView ? t("view") : t("start")
121
122
  })]
122
- }), scheduleListData?.meetingPrompt && /*#__PURE__*/_jsx(Typography, {
123
- variant: "body2",
124
- color: "text.secondary",
123
+ }), /*#__PURE__*/_jsx(Box, {
125
124
  sx: {
126
- lineHeight: 1.6,
127
- whiteSpace: "normal"
125
+ paddingTop: 1
128
126
  },
129
- children: scheduleListData.meetingPrompt
127
+ children: /*#__PURE__*/_jsx(Typography, {
128
+ variant: "body1",
129
+ fontWeight: 600,
130
+ children: scheduleListData.meetingTopic
131
+ })
132
+ }), /*#__PURE__*/_jsx(Box, {
133
+ sx: {
134
+ paddingTop: 1
135
+ },
136
+ children: scheduleListData?.meetingPrompt && /*#__PURE__*/_jsx(Typography, {
137
+ variant: "body2",
138
+ color: "text.secondary",
139
+ sx: {
140
+ lineHeight: 1.6,
141
+ whiteSpace: "normal"
142
+ },
143
+ children: scheduleListData.meetingPrompt
144
+ })
130
145
  })]
131
146
  })
132
147
  })]
@@ -3,6 +3,7 @@ import { Dialog, DialogContent, IconButton, Box, Typography, AppBar, Toolbar, Ci
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
4
  import { red, orange, green, grey } from "@mui/material/colors";
5
5
  import FeedbackCard from "../../Cards/FeedbackCard/FeedbackCard";
6
+ import NualaHeadphonesBackground from "../../img/NualaHeadphonesBackground.svg";
6
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
8
  export default function GroupFeedbackDialog({
8
9
  open = false,
@@ -23,7 +24,9 @@ export default function GroupFeedbackDialog({
23
24
  },
24
25
  conversation = {},
25
26
  handleCreateFeedback = () => {},
26
- onFeedbackSubmitted = () => {}
27
+ onFeedbackSubmitted = () => {},
28
+ editBackgroundImages,
29
+ editMeetingImages
27
30
  }) {
28
31
  const discussionsInGroup = scheduleListData.filter(item => item.groupedId === groupedId);
29
32
  const submissionsForGroup = submissionsTableData.filter(item => item.groupedId === groupedId);
@@ -152,7 +155,27 @@ export default function GroupFeedbackDialog({
152
155
  mb: 3,
153
156
  gap: 4
154
157
  },
155
- children: [/*#__PURE__*/_jsxs(Box, {
158
+ children: [/*#__PURE__*/_jsx(Box, {
159
+ sx: {
160
+ display: "flex",
161
+ flexDirection: "column",
162
+ alignItems: "center",
163
+ justifyContent: "center",
164
+ maxWidth: "25%"
165
+ },
166
+ children: /*#__PURE__*/_jsx("img", {
167
+ src: editMeetingImages || editBackgroundImages || NualaHeadphonesBackground,
168
+ alt: "Meeting Image",
169
+ style: {
170
+ width: "100%",
171
+ maxWidth: "300px",
172
+ height: "auto",
173
+ aspectRatio: "16 / 9",
174
+ objectFit: "cover",
175
+ borderRadius: "8px"
176
+ }
177
+ })
178
+ }), /*#__PURE__*/_jsxs(Box, {
156
179
  sx: {
157
180
  flexBasis: "70%",
158
181
  maxWidth: "70%"
@@ -988,7 +988,7 @@ function Classroom({
988
988
  disabled: false,
989
989
  TabContent: /*#__PURE__*/_jsx(_Fragment, {
990
990
  children: isVideoChatEnabled && isVideoChatEnabledInSettings ? /*#__PURE__*/_jsxs(Box, {
991
- py: 1,
991
+ pt: "8px",
992
992
  children: [/*#__PURE__*/_jsx("div", {
993
993
  className: classes.grow
994
994
  }), /*#__PURE__*/_jsx(Tooltip, {
@@ -1000,7 +1000,8 @@ function Classroom({
1000
1000
  right: theme.spacing(),
1001
1001
  marginRight: theme.spacing(2),
1002
1002
  zIndex: 1,
1003
- size: "large"
1003
+ size: "large",
1004
+ marginTop: "5px"
1004
1005
  },
1005
1006
  size: "large",
1006
1007
  "aria-label": "Refresh",
@@ -1043,16 +1044,19 @@ function Classroom({
1043
1044
  handleArchiveSubmissions: handleArchiveSubmissions
1044
1045
  })
1045
1046
  })
1046
- }), !isCreator && discussions?.length > 0 && /*#__PURE__*/_jsx("div", {
1047
- id: "discussScheduled",
1048
- children: /*#__PURE__*/_jsx(ScheduleListCards, {
1049
- t: t,
1050
- getRecordings: getRecordings,
1051
- userData: classroomMembers,
1052
- joinMeeting: handleJoinMeeting,
1053
- loading: false,
1054
- getSchedules: getSchedules,
1055
- scheduleListData: discussions
1047
+ }), !isCreator && discussions?.length > 0 && /*#__PURE__*/_jsx(Box, {
1048
+ marginTop: "78px",
1049
+ children: /*#__PURE__*/_jsx("div", {
1050
+ id: "discussScheduled",
1051
+ children: /*#__PURE__*/_jsx(ScheduleListCards, {
1052
+ t: t,
1053
+ getRecordings: getRecordings,
1054
+ userData: classroomMembers,
1055
+ joinMeeting: handleJoinMeeting,
1056
+ loading: false,
1057
+ getSchedules: getSchedules,
1058
+ scheduleListData: discussions
1059
+ })
1056
1060
  })
1057
1061
  }), !isCreator && recordingDiscussions?.length > 0 && /*#__PURE__*/_jsx("div", {
1058
1062
  id: "discussRecorded",
@@ -1484,7 +1488,7 @@ function Classroom({
1484
1488
  }), /*#__PURE__*/_jsx(ResponsiveTabs, {
1485
1489
  t: t,
1486
1490
  tabs: tabs,
1487
- fabs: isCreator && isVideoChatEnabled && isVideoChatEnabledInSettings && !isArchived ? courses?.length ? fabs : [[vchatFab]] : isCreator && courses?.length && !isArchived ? [[fabs[0][0], assignmentsFab]] : [],
1491
+ fabs: isCreator && isVideoChatEnabled && isVideoChatEnabledInSettings && !isArchived ? courses?.length ? fabs : [[vchatFab, assignmentsFab]] : isCreator && courses?.length && !isArchived ? [[fabs[0][0], assignmentsFab]] : [],
1488
1492
  centered: true,
1489
1493
  scrollable: true,
1490
1494
  hasNewAssignments: hasNewAssignments,
@@ -1,7 +1,7 @@
1
1
  import { useState, useEffect, Fragment } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { withStyles } from "tss-react/mui";
4
- import { Typography, Box, List, Dialog, DialogContent, Card, CardActionArea, Button, ButtonGroup, IconButton, Tooltip, CircularProgress, Divider } from "@mui/material";
4
+ import { Typography, Box, List, Dialog, DialogContent, Card, CardActionArea, Button, Select, FormControl, InputLabel, IconButton, Tooltip, CircularProgress, Divider, MenuItem } from "@mui/material";
5
5
  import { red, orange, green, grey } from "@mui/material/colors";
6
6
  import Styles from "../../utils/Styles";
7
7
  import ConfirmDeleteDiscussion from "../../Dialogs/ConfirmDeleteDiscussion/ConfirmDeleteDiscussion";
@@ -46,7 +46,7 @@ const MeetingPromptsList = withStyles(({
46
46
  const [isEditMeetingDialogOpen, setIsEditMeetingDialogOpen] = useState(false);
47
47
  const [groupedId, setGroupedId] = useState("");
48
48
  const [meetingMembers, setMeetingMembers] = useState([]);
49
- const [filter, setFilter] = useState("active"); // New state for filter
49
+ const [filter, setFilter] = useState("all");
50
50
  const [isRecordingDialogOpen, setIsRecordingDialogOpen] = useState(false);
51
51
  const [attendeesData, setAttendeesData] = useState([]);
52
52
  const [loading, setLoading] = useState(false);
@@ -76,12 +76,30 @@ const MeetingPromptsList = withStyles(({
76
76
  acc[item.groupedId].push(item);
77
77
  return acc;
78
78
  }, {});
79
- const filteredDiscussions = scheduleListData.filter(item => filter === "active" ? !item.archived : item.archived);
79
+ const now = dayjs();
80
+ const filteredDiscussions = scheduleListData.filter(item => {
81
+ const meetingDateTime = dayjs(`${item.meetingDate} ${item.meetingTime}`, "MM/DD/YYYY h:mm A");
82
+ if (filter === "archived") return item.archived;
83
+ if (item.archived) return false;
84
+ switch (filter) {
85
+ case "all":
86
+ return true;
87
+ case "dueNext":
88
+ return meetingDateTime.isSame(now, "day") || meetingDateTime.isAfter(now);
89
+ case "pastDue":
90
+ return meetingDateTime.isBefore(now, "day");
91
+ default:
92
+ return true;
93
+ }
94
+ });
80
95
  const uniqueGroupedIds = [...new Set(filteredDiscussions.map(item => item.groupedId))];
81
96
  const filteredScheduleListData = uniqueGroupedIds.map(id => filteredDiscussions.find(item => item.groupedId === id));
82
97
  const sortedScheduleListData = filteredScheduleListData.sort((a, b) => {
83
98
  const dateTimeA = new Date(`${a.meetingDate} ${a.meetingTime}`);
84
99
  const dateTimeB = new Date(`${b.meetingDate} ${b.meetingTime}`);
100
+ if (filter === "dueNext") {
101
+ return dateTimeA - dateTimeB;
102
+ }
85
103
  return dateTimeB - dateTimeA;
86
104
  });
87
105
  const groupedRecordings = submissionsTableData.reduce((acc, item) => {
@@ -123,7 +141,7 @@ const MeetingPromptsList = withStyles(({
123
141
  const diffDays = meetingDateTime.startOf("day").diff(now.startOf("day"), "day");
124
142
  let dueText = "";
125
143
  if (diffDays < 0) {
126
- dueText = t("overdue");
144
+ dueText = t("past_due");
127
145
  } else if (diffDays === 0) {
128
146
  dueText = t("due_today");
129
147
  } else if (diffDays === 1) {
@@ -131,42 +149,36 @@ const MeetingPromptsList = withStyles(({
131
149
  } else {
132
150
  dueText = `${t("due_in")} ${diffDays} ${t("days")}`;
133
151
  }
134
- return `${formattedDate} - ${dueText}`;
152
+ return `${dueText} - ${formattedDate}`;
135
153
  };
136
154
  return /*#__PURE__*/_jsxs(Fragment, {
137
- children: [/*#__PURE__*/_jsx(Box, {
138
- sx: {
139
- marginBottom: 2
140
- },
141
- children: /*#__PURE__*/_jsx(Typography, {
142
- variant: "headline",
143
- color: "inherit",
144
- fontSize: 24,
145
- children: t("discussions")
146
- })
147
- }), /*#__PURE__*/_jsxs(ButtonGroup, {
155
+ children: [/*#__PURE__*/_jsxs(FormControl, {
156
+ size: "large",
148
157
  sx: {
149
- marginTop: 2,
150
- marginBottom: 1,
151
- borderRadius: 0
158
+ minWidth: 140,
159
+ marginTop: "8px",
160
+ marginBottom: "16px"
152
161
  },
153
- variant: "outlined",
154
- children: [/*#__PURE__*/_jsx(Button, {
155
- sx: {
156
- borderRadius: 1
157
- },
158
- color: "primary",
159
- variant: filter === "active" ? "contained" : "outlined",
160
- onClick: () => setFilter("active"),
161
- children: t("active")
162
- }), /*#__PURE__*/_jsx(Button, {
163
- sx: {
164
- borderRadius: 1
165
- },
166
- color: "primary",
167
- variant: filter === "archived" ? "contained" : "outlined",
168
- onClick: () => setFilter("archived"),
169
- children: t("archived")
162
+ children: [/*#__PURE__*/_jsx(InputLabel, {
163
+ children: t("view")
164
+ }), /*#__PURE__*/_jsxs(Select, {
165
+ value: filter,
166
+ onChange: e => setFilter(e.target.value),
167
+ label: t("view"),
168
+ autoWidth: true,
169
+ children: [/*#__PURE__*/_jsx(MenuItem, {
170
+ value: "all",
171
+ children: t("all")
172
+ }), /*#__PURE__*/_jsx(MenuItem, {
173
+ value: "dueNext",
174
+ children: t("due_next")
175
+ }), /*#__PURE__*/_jsx(MenuItem, {
176
+ value: "pastDue",
177
+ children: t("past_due")
178
+ }), /*#__PURE__*/_jsx(MenuItem, {
179
+ value: "archived",
180
+ children: t("archived")
181
+ })]
170
182
  })]
171
183
  }), /*#__PURE__*/_jsxs(List, {
172
184
  children: [sortedScheduleListData.slice(0, cardsToShow).map((discussion, i) => {
@@ -184,6 +196,7 @@ const MeetingPromptsList = withStyles(({
184
196
  component: "a",
185
197
  onClick: () => {
186
198
  setSelectedGroup(discussion);
199
+ setSelectedDiscussion(discussion);
187
200
  setGroupedId(discussion?.groupedId);
188
201
  openDialog();
189
202
  },
@@ -198,7 +211,7 @@ const MeetingPromptsList = withStyles(({
198
211
  alignItems: "center"
199
212
  },
200
213
  children: [/*#__PURE__*/_jsx(Typography, {
201
- variant: "h6",
214
+ variant: "body1",
202
215
  fontWeight: 600,
203
216
  sx: {
204
217
  color: "text.primary"
@@ -210,13 +223,14 @@ const MeetingPromptsList = withStyles(({
210
223
  alignItems: "center",
211
224
  gap: 1
212
225
  },
213
- children: filter === "active" && /*#__PURE__*/_jsxs(_Fragment, {
226
+ children: filter !== "archived" && /*#__PURE__*/_jsxs(_Fragment, {
214
227
  children: [/*#__PURE__*/_jsx(Typography, {
215
- variant: "body2",
228
+ variant: "button",
216
229
  color: "text.secondary",
217
230
  sx: {
218
231
  ml: 1.5,
219
- fontWeight: 500
232
+ fontWeight: 500,
233
+ mr: "16px"
220
234
  },
221
235
  children: formatMeetingDueText(discussion?.meetingDate, discussion?.meetingTime, t)
222
236
  }), /*#__PURE__*/_jsx(Tooltip, {
@@ -253,7 +267,8 @@ const MeetingPromptsList = withStyles(({
253
267
  })]
254
268
  }), /*#__PURE__*/_jsx(Divider, {
255
269
  sx: {
256
- my: 1.5
270
+ mt: "16px",
271
+ mb: "10px"
257
272
  }
258
273
  }), /*#__PURE__*/_jsxs(Box, {
259
274
  sx: {
@@ -326,7 +341,7 @@ const MeetingPromptsList = withStyles(({
326
341
  variant: "caption",
327
342
  sx: {
328
343
  mt: 1,
329
- fontWeight: 'bold',
344
+ fontWeight: "bold",
330
345
  color: ringColor,
331
346
  textAlign: "center",
332
347
  textTransform: "uppercase",
@@ -374,7 +389,9 @@ const MeetingPromptsList = withStyles(({
374
389
  playerRef: playerRef,
375
390
  conversation: conversation,
376
391
  handleCreateFeedback: handleCreateFeedback,
377
- onFeedbackSubmitted: getRecordings
392
+ onFeedbackSubmitted: getRecordings,
393
+ editBackgroundImages: editBackgroundImages[0],
394
+ editMeetingImages: editMeetingImages[0]
378
395
  }), /*#__PURE__*/_jsx(Dialog, {
379
396
  role: "dialog",
380
397
  open: isRecordingDialogOpen,
@@ -34,17 +34,7 @@ const ScheduleListCards = withStyles(({
34
34
  return dateTimeA - dateTimeB;
35
35
  }
36
36
  return /*#__PURE__*/_jsxs(Fragment, {
37
- children: [/*#__PURE__*/_jsx(Box, {
38
- sx: {
39
- marginBottom: 2
40
- },
41
- children: /*#__PURE__*/_jsx(Typography, {
42
- variant: "headline",
43
- color: "inherit",
44
- fontSize: 24,
45
- children: t("scheduled")
46
- })
47
- }), loading ? /*#__PURE__*/_jsxs(_Fragment, {
37
+ children: [loading ? /*#__PURE__*/_jsxs(_Fragment, {
48
38
  children: [/*#__PURE__*/_jsx(LoadingCard, {}), /*#__PURE__*/_jsx(LoadingCard, {})]
49
39
  }) : futureMeetings && futureMeetings.length > 0 ? futureMeetings.sort(compare).slice(0, cardsToShow) // Modify mapping to display only the desired number of cards
50
40
  .map((row, i) => /*#__PURE__*/_jsx(ScheduleCard, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1306",
3
+ "version": "0.1.1308",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -21,7 +21,6 @@
21
21
  "@hookform/resolvers": "^3.6.0",
22
22
  "@json2csv/plainjs": "^7.0.1",
23
23
  "@nualang/avatars": "2.0.3",
24
- "@nualang/nualang-api-and-queries": "^1.1.23",
25
24
  "@nualang/rivescript": "^2.2.2-alpha1",
26
25
  "@stripe/react-stripe-js": "^2.1.1",
27
26
  "@stripe/stripe-js": "^1.54.2",
@@ -74,7 +73,6 @@
74
73
  "react-markdown": "^8.0.7",
75
74
  "react-modal-promise": "^1.0.2",
76
75
  "react-papaparse": "^4.1.0",
77
- "react-pdf": "^7.7.1",
78
76
  "react-player": "^3.3.2",
79
77
  "react-qrcode-logo": "^3.0.0",
80
78
  "react-refresh": "^0.17.0",
@@ -102,6 +100,7 @@
102
100
  "@mui/system": "^7.0.2",
103
101
  "@mui/x-date-pickers": "^7.28.3",
104
102
  "@nualang/eslint-config-nualang": "0.2.0-alpha-4",
103
+ "@nualang/nualang-api-and-queries": "^1.1.25",
105
104
  "@react-theming/storybook-addon": "^1.1.10",
106
105
  "@storybook/addon-docs": "^10.0.2",
107
106
  "@storybook/addon-links": "^10.0.2",
@@ -130,6 +129,7 @@
130
129
  "prettier": "^3.2.5",
131
130
  "react": "19.2.0",
132
131
  "react-dom": "19.2.0",
132
+ "react-pdf": "^10.2.0",
133
133
  "react-router-dom": "^6.30.0",
134
134
  "rimraf": "^6.1.0",
135
135
  "storybook": "^10.0.2",