import type { SchoolLevel } from '../types'

export type { SchoolLevel }

export const SCHOOL_LEVEL_LABELS: Record<SchoolLevel, string> = {
  junior_high: '初中',
  senior_high: '高中',
}

export const GRADE_OPTIONS: Record<SchoolLevel, string[]> = {
  junior_high: ['初一', '初二', '初三'],
  senior_high: ['高一', '高二', '高三'],
}

export function formatStudentMeta(student: {
  school_level: SchoolLevel
  grade?: string | null
  class_name?: string | null
}): string {
  const parts = [
    SCHOOL_LEVEL_LABELS[student.school_level],
    student.grade,
    student.class_name,
  ].filter(Boolean)
  return parts.length ? parts.join(' · ') : '未设置学段年级'
}
