feat: enhance routing and UI components for intern and mentor sections

This commit is contained in:
Kemas M. Aryadary Rasyad
2026-07-16 12:05:50 +07:00
parent 5689898f33
commit 99082efbdb
8 changed files with 90 additions and 57 deletions
@@ -93,7 +93,7 @@ export default function SidebarIntern({ isOpen, closeSidebar }: SidebarProps) {
PREFERENCES
</p>
<nav className="flex flex-col gap-0.5">
{prefItems.map(({ label, icon: Icon, path, danger, isLogout }) => {
{prefItems.map(({ label, icon: Icon, path, isLogout }) => {
const isActive = location.pathname === path;
return (
<button
@@ -42,7 +42,7 @@ export default function SubmitStatusTable({
: "Assignment was submitted early";
const rows = [
{ label: "Submission status", value: "Submitted for grading" },
{ label: "Submission status", value: "Submitted" },
{ label: "Time Remaining", value: timeLabel },
];
@@ -23,12 +23,18 @@ export default function MentorProjectsPage() {
refetch();
};
const STATUS_ORDER: Record<string, number> = {
active: 0,
completed: 1,
archived: 2,
};
const renderContent = () => {
if (loading) {
return (
<div className="flex flex-row gap-3 w-full">
{[...Array(4)].map((_, i) => (
{[...Array(4)].map((_) => (
<MentorProjectCardSkeleton />
))}
</div>
@@ -48,7 +54,12 @@ export default function MentorProjectsPage() {
);
}
return projects.map(project => (
const sorted = [...projects].sort(
(a, b) =>
(STATUS_ORDER[a.status] ?? 99) - (STATUS_ORDER[b.status] ?? 99)
);
return sorted.map(project => (
<MentorProjectCard
key={project.id}
{...project}
@@ -1,4 +1,4 @@
import { useRef, useEffect, useState, useCallback } from "react";
import { useRef, useEffect, useState } from "react";
import { X } from "lucide-react";
import { PROJECT_ICON_MAP, PROJECT_ICON_CODES } from "../../../../lib/ProjectIcons";
import { LuSendHorizontal, LuMail } from "react-icons/lu";