import Link from "next/link"; import { notFound } from "next/navigation"; import { ArrowLeft } from "lucide-react"; import { buttonVariants } from "@/components/ui/button"; import { getMaestroDetail } from "@/lib/maestros"; import { formatDate, formatDateTime, getAccountTypeLabel, getActivateStatusLabel, getRequestStatusLabel, } from "@/lib/utils"; import { MaestroEditForm } from "./MaestroEditForm"; import { StudentsSection } from "./StudentsSection"; type MaestroDetailPageProps = { params: Promise<{ maestroId: string; }>; }; export default async function MaestroDetailPage({ params, }: MaestroDetailPageProps) { const { maestroId } = await params; const maestroID = Number(maestroId); if (!Number.isInteger(maestroID) || maestroID <= 0) { notFound(); } const detail = await getMaestroDetail(maestroID); if (!detail) { notFound(); } const { maestro } = detail; return (

기본 정보

연장 신청 이력

전체 {detail.counts.extensionRequests.toLocaleString()}건 중 최근 20건

[ request.maestroExtensionID, getAccountTypeLabel(request.accountType), formatDateTime(request.requestedDateTime), getRequestStatusLabel(request.status), ])} />

업그레이드 신청 이력

전체 {detail.counts.upgradeRequests.toLocaleString()}건 중 최근 20건

[ request.maestroUpgradeID, getAccountTypeLabel(request.registeredAccountType), getAccountTypeLabel(request.requestedAccountType), formatDateTime(request.requestedDateTime), getRequestStatusLabel(request.status), ])} />

처리 로그

전체 {detail.counts.logs.toLocaleString()}건 중 최근 30건

[ log.maestroLogID, log.type, formatDateTime(log.logDateTime), log.remark, ])} />
); } function SummaryCard({ label, value }: { label: string; value: string }) { return (

{label}

{value}

); } function SimpleTable({ headers, rows, emptyText, }: { headers: string[]; rows: Array>; emptyText: string; }) { return (
{headers.map((header) => ( ))} {rows.length > 0 ? ( rows.map((row, index) => ( {row.map((cell, cellIndex) => ( ))} )) ) : ( )}
{header}
{cell}
{emptyText}
); }