import React from 'react';

export const COLORS = [
  '#007AFF',
  '#34C759',
  '#FF9500',
  '#FF3B30',
  '#5AC8FA',
  '#AF52DE',
  '#FF2D55',
  '#FFCC00',
];

export interface BillStatRow {
  status: string;
  count: string;
  total: string;
}
export interface ClassAttendanceRank {
  className: string;
  present: number;
  total: number;
  rate: number;
}
export interface ClassroomOccupancy {
  name: string;
  building: string;
  capacity: number;
  scheduleDays: number;
  rentalCount: number;
  occupancy: number;
}
export interface ClassroomUtilStats {
  totalClassrooms: number;
  inUseCount: number;
  utilizationRate: string;
  scheduleCount: number;
  rentalCount: number;
}
export interface AttendanceTrendRow {
  date: string;
  rate: string;
}
export interface IncomeTrendRow {
  month: string;
  amount: number;
}
export interface OccupancyByBuildingRow {
  building: string;
  count: string;
}
export interface ExpenseByTypeRow {
  type: string;
  total: string;
}
export interface GanttOccupancy {
  studentName: string;
  studentId?: string | number;
  checkInDate: string;
  checkOutDate: string | null;
  billingStartDate?: string;
  billingEndDate?: string;
}
export interface GanttRoom {
  roomNumber: string;
  occupancies: GanttOccupancy[];
}

export interface DashboardStats {
  totalRooms: number;
  totalStudents: number;
  occupiedBeds: number;
  totalCapacity: number;
  occupancyRate: string;
  billStats: BillStatRow[];
  classroomCount: number;
  classroomOccupancyRate: string;
  todayAttendanceRate?: string;
  monthlyIncome: number;
  classCount: number;
  teacherCount: number;
  pendingDeposits: number;
  activeRentals: number;
  todayPresent: number;
  occupancyByBuilding: OccupancyByBuildingRow[];
  attendanceByStatus: Record<string, number>;
  expenseByType: ExpenseByTypeRow[];
  attendanceTrend: AttendanceTrendRow[];
  incomeTrend: IncomeTrendRow[];
}

export const attendanceLabelMap: Record<string, string> = {
  present: '出勤',
  absent: '缺勤',
  late: '迟到',
  early: '早退',
  leave: '请假',
};

export const SECTION_ROW_STYLE: React.CSSProperties = { marginBottom: 24 };
export const MARGIN_BOTTOM_16_STYLE: React.CSSProperties = { marginBottom: 16 };

export const TODO_CARD_BASE: React.CSSProperties = {
  cursor: 'pointer',
  transition: 'box-shadow 0.2s, transform 0.2s',
  borderRadius: 8,
  height: '100%',
};
export const TODO_CARD_WARN: React.CSSProperties = {
  ...TODO_CARD_BASE,
  borderLeft: '4px solid #FF9500',
  background: '#fff7e6',
};
export const TODO_CARD_DANGER: React.CSSProperties = {
  ...TODO_CARD_BASE,
  borderLeft: '4px solid #FF3B30',
  background: '#fff1f0',
};
export const TODO_CARD_OK: React.CSSProperties = {
  ...TODO_CARD_BASE,
  borderLeft: '4px solid #34C759',
  background: '#f0fff4',
};
export const TODO_CARD_DRAFT: React.CSSProperties = {
  ...TODO_CARD_BASE,
  borderLeft: '4px solid #AF52DE',
  background: '#f9f0ff',
};
