"use client"; import { type ReactNode } from "react"; import { useAcademicYears } from "@/hooks/use-school"; import { PaperCard, LoadingState, ErrorState, EmptyState, Table, TableRow, TableCell, } from "@/components/ui"; import { t } from "@/lib/i18n"; import type { AcademicYearViewModel } from "@/types/view-models"; function CurrentBadge(): ReactNode { const color = "var(--color-success)"; return ( {t("admin.school.currentYear")} ); } export default function AcademicYearPage(): ReactNode { const { data, loading, error } = useAcademicYears(); return ( {loading && } {error && } {!loading && !error && ( <> {data.length === 0 ? ( ) : ( {data.map((year: AcademicYearViewModel) => ( {year.name} {year.startDate} {year.endDate} {year.firstSemesterStart} ~ {year.firstSemesterEnd} {year.secondSemesterStart} ~ {year.secondSemesterEnd} {year.isCurrent ? : "—"} ))}
)} )}
); }