import React from 'react';
import {
Avatar,
Button,
DatePicker,
Select,
Spin,
Tooltip,
} from 'antd';
import {
ExportOutlined,
FileSearchOutlined,
ReloadOutlined,
ScheduleOutlined,
UndoOutlined,
WarningFilled,
} from '@ant-design/icons';
import dayjs, { type Dayjs } from 'dayjs';
import PermissionButton from '../../components/PermissionButton';
import {
ADMIN_METRIC_META,
STATUS_META,
type AlertItem,
type AttendanceSummary,
type ClassOption,
type DingTalkSyncStatus,
type HistoryScheduleOption,
} from './AttendanceAdmin.helpers';
export const AttendanceAdminHeader: React.FC<{
syncStatus: DingTalkSyncStatus | null;
canEdit: boolean;
refreshingDingTalk: boolean;
onOpenPeriodConfig: () => void;
onRefreshDingTalk: () => void;
onExport: () => void;
attendanceDate: Dayjs | null;
onDateChange: (date: Dayjs | null) => void;
classId?: number;
onClassChange: (value?: number) => void;
classOptions: ClassOption[];
effectiveScheduleId?: number;
onScheduleChange: (value?: number) => void;
scheduleOptions: HistoryScheduleOption[];
scheduleOptionsLoading: boolean;
session?: string;
onSessionChange: (value?: string) => void;
sessionOptions: Array<{ value: string; label: string }>;
onReset: () => void;
onQuery: () => void;
selectedClass: string;
dateLabel: string;
visibleStudentCount: number;
total: number;
headTeacherNames: string;
lifeTeacherNames: string;
subjectTeacherNames: string;
attendanceRate: number;
summary: AttendanceSummary;
metricFilter: string;
onMetricFilterChange: (key: string) => void;
alerts: AlertItem[];
}> = ({
syncStatus,
canEdit,
refreshingDingTalk,
onOpenPeriodConfig,
onRefreshDingTalk,
onExport,
attendanceDate,
onDateChange,
classId,
onClassChange,
classOptions,
effectiveScheduleId,
onScheduleChange,
scheduleOptions,
scheduleOptionsLoading,
session,
onSessionChange,
sessionOptions,
onReset,
onQuery,
selectedClass,
dateLabel,
visibleStudentCount,
total,
headTeacherNames,
lifeTeacherNames,
subjectTeacherNames,
attendanceRate,
summary,
metricFilter,
onMetricFilterChange,
alerts,
}) => {
return (
<>
{dateLabel} · 当前展示 {visibleStudentCount} 名学生 / {total} 条记录
学生考勤中心
班级考勤总览
{selectedClass}