import RoleLayout, { NavGroup } from "./RoleLayout";
import ExamPopup from "./student/ExamPopup";
import {
  LayoutDashboard, BookOpen, ClipboardList, BarChart3,
  CalendarCheck, Calendar, User, Target, ListChecks,
  MessageSquare, Megaphone, Mail, TrendingUp,
} from "lucide-react";

/**
 * Student portal shell. Nav items hold i18n keys which `RoleLayout`
 * resolves via `useTranslation`, so switching language does not require
 * re-mounting the layout.
 */
const navGroups: NavGroup[] = [
  {
    labelKey: "sidebarGroup.learning",
    items: [
      { titleKey: "nav.dashboard", url: "/student/dashboard", icon: LayoutDashboard },
      { titleKey: "nav.myCourses", url: "/student/courses", icon: BookOpen },
      { titleKey: "nav.subjectRegistration", url: "/student/subject-registration", icon: ListChecks },
      { titleKey: "nav.assignments", url: "/student/assignments", icon: ClipboardList },
    ],
  },
  {
    labelKey: "sidebarGroup.adaptiveLearning",
    items: [
      { titleKey: "nav.mySubjects", url: "/student/subjects", icon: Target },
    ],
  },
  {
    labelKey: "sidebarGroup.progress",
    items: [
      { titleKey: "nav.grades", url: "/student/grades", icon: BarChart3 },
      { titleKey: "nav.attendance", url: "/student/attendance", icon: CalendarCheck },
      { titleKey: "nav.timetable", url: "/student/timetable", icon: Calendar },
      { titleKey: "nav.myJourney", url: "/student/journey", icon: TrendingUp },
    ],
  },
  {
    labelKey: "sidebarGroup.communication",
    items: [
      { titleKey: "nav.discussions", url: "/student/discussions", icon: MessageSquare },
      { titleKey: "nav.messages", url: "/student/messages", icon: Mail },
      { titleKey: "nav.announcements", url: "/student/announcements", icon: Megaphone },
    ],
  },
  {
    labelKey: "sidebarGroup.account",
    items: [
      { titleKey: "nav.profile", url: "/student/profile", icon: User },
    ],
  },
];

export default function StudentLayout() {
  return (
    <>
      <RoleLayout navGroups={navGroups} role="student" />
      <ExamPopup />
    </>
  );
}
