import {
  type CalibrationReviewDetail,
  type PerformanceReviewCoreFormQuestion,
  type ReviewDetailFormQuestions,
  type ReviewDetailFormQuestionsGoalItem,
} from 'src/pages/dashboard/performance/types';

import { type CalibrationUser } from '../types';

/** Form values: dynamic keys (questionId → answer, questionId + COMMENT → comment). */
export type CalibrationFormValues = Record<string, unknown>;

/**
 * Props for CalibrationForm.
 */
export type CalibrationFormProps = {
  /** Cycle ID from the route. */
  cycleId: string | number;
  /** Detail payload from getCalibrationDetail. */
  detail: CalibrationReviewDetail;
  /** Evaluated employee resolved from the sidebar list (header is graceful if missing). */
  user?: CalibrationUser | null;
};

export type CalibrationFormQuestion = PerformanceReviewCoreFormQuestion;

/** Questions split by section type, produced by `splitReviewInputs`. */
export type CalibrationBuckets = {
  formQuestions: ReviewDetailFormQuestions[];
  goalQuestions: ReviewDetailFormQuestionsGoalItem[];
  competencyQuestions: ReviewDetailFormQuestions[];
};
