import type {
  DirectorDashboardTimeRange,
  DirectorQuickActionConfig,
} from '@/shared/constants/directorDashboard';
import type { ModuleId } from '@/shared/types/app';
import type { SafetyQuizResultDto } from '@/shared/types/safetyQuiz';

export type DirectorDashboardTrend = 'up' | 'down';
export type DirectorDashboardRiskSeverity = 'high' | 'medium' | 'low';
export type DirectorOverviewIconId = 'clock' | 'shield' | 'eye' | 'users' | 'clipboard';
export type DirectorOverviewTone = 'orange' | 'blue' | 'amber' | 'purple' | 'emerald';
export type DirectorFrameSectionLetter = 'F' | 'R' | 'A' | 'M' | 'E';

export interface DirectorOverviewCard {
  readonly label: string;
  readonly value: string;
  readonly change: string;
  readonly trend: DirectorDashboardTrend;
  readonly iconId: DirectorOverviewIconId;
  readonly tone: DirectorOverviewTone;
  readonly module: ModuleId;
}

export interface DirectorRiskArea {
  readonly issue: string;
  readonly severity: DirectorDashboardRiskSeverity;
  readonly module: ModuleId;
}

export interface DirectorFrameSectionPreview {
  readonly letter: DirectorFrameSectionLetter;
  readonly text: string;
}

export interface DirectorFramePreview {
  readonly id: string;
  readonly week: string;
  readonly sections: readonly DirectorFrameSectionPreview[];
}

export interface DirectorDashboardPage {
  /** Role-specific dashboard title (e.g. "Owner Dashboard"). */
  readonly title: string;
  /** Name of the tenant whose data is shown (org/school/campus). */
  readonly scopeLabel: string;
  readonly timeRange: DirectorDashboardTimeRange;
  readonly overviewCards: readonly DirectorOverviewCard[];
  readonly riskAreas: readonly DirectorRiskArea[];
  readonly framePreviews: readonly DirectorFramePreview[];
  readonly quickActions: readonly DirectorQuickActionConfig[];
  readonly quizResults: readonly SafetyQuizResultDto[];
  readonly isLoading: boolean;
  readonly error: unknown;
  readonly setTimeRange: (timeRange: DirectorDashboardTimeRange) => void;
}
