pushy

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-06-28 11:30:01 +08:00
parent b03b204861
commit bac7168b1e
100 changed files with 5958 additions and 1976 deletions
@@ -17,6 +17,7 @@ import {
PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis,
} from '@/components/ui/pagination';
import { useAdminCourseReadingProgress } from '@/contexts/AdminCourseReadingProgressContext';
import { useDateFormat } from '@/hooks/useDateFormat';
const PAGE_SIZE = 10;
@@ -64,6 +65,7 @@ function UserAvatar({ name, email, avatarUrl }) {
function UserDetailDialog({ open, onOpenChange, entry, courseId }) {
const { detailCache, detailLoading, fetchUserReadingProgress } = useAdminCourseReadingProgress();
const { fmtDate, fmtDateShort } = useDateFormat();
const breakdown = entry ? detailCache[entry.user_id] : null;
useEffect(() => {
@@ -72,9 +74,7 @@ function UserDetailDialog({ open, onOpenChange, entry, courseId }) {
}
}, [open, entry]);
const lastSeen = entry?.last_accessed_at
? new Date(entry.last_accessed_at).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })
: '—';
const lastSeen = entry?.last_accessed_at ? fmtDate(entry.last_accessed_at) : '—';
return (
<Dialog open={open} onOpenChange={onOpenChange}>
@@ -154,7 +154,7 @@ function UserDetailDialog({ open, onOpenChange, entry, courseId }) {
</span>
{lesson.status === 'completed' && lesson.completed_at && (
<span className="text-xs text-muted-foreground whitespace-nowrap shrink-0">
{new Date(lesson.completed_at).toLocaleDateString('en-US', { month: 'short', day: 'numeric' })}
{fmtDateShort(lesson.completed_at)}
</span>
)}
</div>
@@ -178,9 +178,8 @@ function UserDetailDialog({ open, onOpenChange, entry, courseId }) {
// ─── User summary card ────────────────────────────────────────────────────────
function UserCard({ entry, onOpen }) {
const lastSeen = entry.last_accessed_at
? new Date(entry.last_accessed_at).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })
: '—';
const { fmtDate } = useDateFormat();
const lastSeen = entry.last_accessed_at ? fmtDate(entry.last_accessed_at) : '—';
return (
<button