testing 127.0.0.1 issue

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-07 13:40:07 +08:00
parent 244aa607f7
commit 6624c0d27f
62 changed files with 662 additions and 1889 deletions
@@ -11,7 +11,7 @@
* loading {boolean} – show skeleton rows
* onRefresh {function} – called when refresh button is clicked
* onRowClick {function} – (taskList) => void, navigates to task list view
* statusLabel {string} – 'ongoing' | 'done' | 'overdue' — drives badge style
* statusLabel {string} – 'ongoing' | 'completed' | 'overdue' — drives badge style
***********************************************************************************************************************************************************************/
import { useState, useMemo } from 'react';
import { Input } from '@/components/ui/input';
@@ -35,9 +35,9 @@ const PAGE_SIZES = [50, 100, 1000];
// ─── Status badge per bucket ───────────────────────────────────────────────────
const StatusBadge = ({ status }) => {
const map = {
ongoing: { label: 'Ongoing', icon: Circle, className: 'bg-muted text-muted-foreground' },
done: { label: 'Done', icon: Check, className: 'bg-green-500/10 text-green-700 dark:text-green-400' },
overdue: { label: 'Overdue', icon: AlertTriangle, className: 'bg-destructive/10 text-destructive' },
ongoing: { label: 'Ongoing', icon: Circle, className: 'bg-muted text-muted-foreground' },
completed: { label: 'Completed', icon: Check, className: 'bg-green-500/10 text-green-700 dark:text-green-400' },
overdue: { label: 'Overdue', icon: AlertTriangle, className: 'bg-destructive/10 text-destructive' },
};
const { label, icon: Icon, className } = map[status] ?? map.ongoing;
return (
@@ -180,13 +180,7 @@ const FileUpload = ({
if (rejected.length > 0) {
setTimeout(() => toast(
`${rejected.length === 1 ? `"${rejected[0]}" is` : `${rejected.length} files are`} not allowed. ` +
`Accepted types: ${allowed.join(", ")}.`,
{
action: {
label: "Close",
onClick: () => {}
}
}
`Accepted types: ${allowed.join(", ")}.`
), 0);
}
}
@@ -197,25 +191,13 @@ const FileUpload = ({
const availableSlots = maxFileCount - prev.length;
if (availableSlots <= 0) {
setTimeout(() => toast(
`You can only attach up to ${maxFileCount} file${maxFileCount !== 1 ? "s" : ""}.`,
{
action: {
label: "Close",
onClick: () => {}
}
}
`You can only attach up to ${maxFileCount} file${maxFileCount !== 1 ? "s" : ""}.`
), 0);
incoming = [];
} else if (incoming.length > availableSlots) {
setTimeout(() => toast(
`Only ${availableSlots} more file${availableSlots !== 1 ? "s" : ""} can be added ` +
`(max ${maxFileCount}).`,
{
action: {
label: "Close",
onClick: () => {}
}
}
`(max ${maxFileCount}).`
), 0);
incoming = incoming.slice(0, availableSlots);
}
@@ -242,12 +224,7 @@ const FileUpload = ({
if (duplicates.length > 0) {
setTimeout(() => toast(duplicates.length === 1
? `"${duplicates[0]}" is already attached.`
: `${duplicates.length} files are already attached.`, {
action: {
label: "Close",
onClick: () => {}
}
}), 0);
: `${duplicates.length} files are already attached.`), 0);
}
const next = prev.concat(toAdd);
toAdd.forEach((e) => simulateUpload(e.id));
@@ -40,12 +40,7 @@ const ReadCourse = ({ title = "Read Course", courses = [], groupId, taskListId,
courses.forEach((course) => {
const prev = prevCompletedRef.current[course.id];
if (course.completed && prev === false) {
toast(`"${course.title}" has been automatically turned in!`, {
action: {
label: "Close",
onClick: () => {}
}
});
toast(`"${course.title}" has been automatically turned in!`);
}
prevCompletedRef.current[course.id] = !!course.completed;
});
@@ -96,7 +96,7 @@ const LinkCard = ({ link, visited, onTurnIn, onUnvisit, submitting, unsubmitting
footer={
<>
<Button variant="outline" onClick={() => setModalOpen(false)}>Cancel</Button>
<Button onClick={handleTurnIn} disabled={submitting}>
<Button onClick={handleTurnIn} disabled={submitting}>
<SendHorizonal /> {submitting ? "Submitting…" : "Turn In"}
</Button>
</>