import type { FrameEntryViewModel } from '@/business/frame/types';
import type {
  DashboardQuickAction,
  DashboardZoneOption,
} from '@/shared/constants/dashboard';
import type {
  ModuleId,
  UserRole,
  ZoneColor,
} from '@/shared/types/app';
import type { CommunicationEventDto } from '@/shared/types/communications';
import type {
  DashboardComplianceItem,
  DashboardEncouragingQuote,
  DashboardSignOfWeek,
} from '@/shared/types/dashboard';

export interface DashboardProps {
  readonly userRole: UserRole;
  readonly userName: string;
  readonly setCurrentModule: (id: ModuleId) => void;
  readonly zoneCheckIn: string | null;
  readonly setZoneCheckIn: (zone: string | null) => void;
}

export interface DashboardPage {
  readonly userRole: UserRole;
  readonly userName: string;
  readonly greeting: string;
  readonly latestFrame: FrameEntryViewModel | null;
  readonly todayQuote: DashboardEncouragingQuote | null;
  readonly quoteState: DashboardContentState;
  readonly zoneOptions: readonly DashboardZoneOption[];
  readonly activeZone: ZoneColor | null;
  readonly isZoneSaving: boolean;
  readonly zoneErrorMessage: string | null;
  readonly upcomingEvents: readonly CommunicationEventDto[];
  readonly eventsState: DashboardContentState;
  readonly complianceItems: readonly DashboardComplianceItem[];
  readonly complianceState: DashboardContentState;
  readonly signOfWeek: DashboardSignOfWeek | null;
  readonly signOfWeekState: DashboardContentState;
  readonly quickActions: readonly DashboardQuickAction[];
  readonly goToModule: (id: ModuleId) => void;
  readonly checkInZone: (zone: ZoneColor) => Promise<void>;
  readonly resetZone: () => Promise<void>;
}

export interface DashboardContentState {
  readonly isLoading: boolean;
  readonly isError: boolean;
}
