// Типы для Timesheet Demo модульной архитектуры

// Основные типы данных календаря
export interface CalendarDay {
  day: number
  status: string
  hours: number
  overtime: number
  workType: string | null
  mood: string | null
  efficiency: number | null
  tasks: number
  breaks: number
}

// Интерфейс сотрудника
export interface Employee {
  id: string
  name: string
  position: string
  avatar: string
  department: string
  level: 'Junior' | 'Middle' | 'Senior' | 'Lead'
  experience: string
  efficiency: number
  totalHours: number
  workDays: number
  overtime: number
  projects: number
}

// Статистика табеля
export interface TimesheetStats {
  totalHours: number
  workDays: number
  overtime: number
  efficiency: number
  completedTasks: number
  projects: number
  averageHoursPerDay: number
  weekendWork: number
}

// Типы вариантов отображения
export type TimesheetVariant = 'galaxy' | 'cosmic' | 'custom' | 'compact' | 'interactive' | 'multi-employee'

// Пропсы для основного компонента
export interface TimesheetDemoProps {
  initialVariant?: TimesheetVariant
  initialEmployee?: string
  showVariantSelector?: boolean
}

// Пропсы для блоков
export interface TimesheetBlockProps {
  employee: Employee
  selectedMonth: number
  selectedYear: number
  calendarData: CalendarDay[]
  stats: TimesheetStats
  onMonthChange: (direction: 'prev' | 'next') => void
  onEmployeeChange: (employeeId: string) => void
  onCalendarUpdate?: (data: CalendarDay[]) => void
}

export interface GalaxyVariantBlockProps {
  employee: Employee
  calendarData: CalendarDay[]
  stats: TimesheetStats
  utils: UseTimesheetUtilsReturn
  selectedMonth: number
  selectedYear: number
}

export interface CosmicVariantBlockProps {
  employee: Employee
  calendarData: CalendarDay[]
  stats: TimesheetStats
  utils: UseTimesheetUtilsReturn
  selectedMonth: number
  selectedYear: number
}

export interface CustomVariantBlockProps {
  employee: Employee
  calendarData: CalendarDay[]
  stats: TimesheetStats
  utils: UseTimesheetUtilsReturn
  selectedMonth: number
  selectedYear: number
}

export interface CompactVariantBlockProps {
  employee: Employee
  calendarData: CalendarDay[]
  stats: TimesheetStats
  utils: UseTimesheetUtilsReturn
  selectedMonth: number
  selectedYear: number
}

export interface InteractiveVariantBlockProps {
  employee: Employee
  calendarData: CalendarDay[]
  stats: TimesheetStats
  utils: UseTimesheetUtilsReturn
  selectedMonth: number
  selectedYear: number
  onUpdateDay?: (day: number, data: CalendarDay) => void
}

export interface MultiEmployeeVariantBlockProps {
  employees: Employee[]
  employeeStats: Record<string, TimesheetStats>
  selectedMonth: number
  selectedYear: number
  utils: UseTimesheetUtilsReturn
}

// Хуки интерфейсы
export interface UseTimesheetStateReturn {
  selectedVariant: TimesheetVariant
  selectedEmployee: string
  selectedMonth: number
  selectedYear: number
  calendarData: CalendarDay[]
  editableCalendarData: CalendarDay[]
  animatedStats: boolean
  setSelectedVariant: (variant: TimesheetVariant) => void
  setSelectedEmployee: (employeeId: string) => void
  setSelectedMonth: (month: number) => void
  setSelectedYear: (year: number) => void
  setCalendarData: (data: CalendarDay[]) => void
  setEditableCalendarData: (data: CalendarDay[]) => void
  setAnimatedStats: (animated: boolean) => void
  handleMonthChange: (direction: 'prev' | 'next') => void
}

export interface UseEmployeeManagementReturn {
  employees: Employee[]
  selectedEmployee: Employee | undefined
  addEmployee: (employee: Employee) => void
  removeEmployee: (employeeId: string) => void
  updateEmployee: (employeeId: string, updates: Partial<Employee>) => void
  generateEmployeeCalendarData: (employeeId: string, month: number, year: number) => CalendarDay[]
}

export interface UseTimesheetStatsReturn {
  stats: TimesheetStats
  calculateStats: (calendarData: CalendarDay[], employee: Employee) => TimesheetStats
}

export interface UseTimesheetUtilsReturn {
  getStatusColor: (status: string) => string
  getStatusIcon: (status: string) => React.ComponentType
  getMoodIcon: (mood: string | null) => React.ComponentType | null
  getWorkTypeIcon: (workType: string | null) => React.ComponentType | null
  formatHours: (hours: number) => string
  formatEfficiency: (efficiency: number | null) => string
  getMonthName: (month: number) => string
  getDaysInMonth: (month: number, year: number) => number
  getFirstDayOfMonth: (month: number, year: number) => number
}

// Константы
export interface WorkStatus {
  key: string
  label: string
  color: string
  icon: React.ComponentType
}

export interface WorkType {
  key: string
  label: string
  icon: React.ComponentType
}

export interface MoodType {
  key: string
  label: string
  icon: React.ComponentType
  color: string
}