import type { ScheduleMode } from "./OpportunityScheduleDates";

/**
 * The shapes the volunteering publish form works in.
 *
 * `VolunteerFormValues` is Formik's value object and is also what the
 * validation and the payload builder are written against, so it is the form's
 * real contract and belongs where all three can import it.
 */
export interface VolunteerFormNavState {
  id?: string;
  isRepublish?: boolean;
}

export interface VolunteerFormValues {
  license_image_removed: boolean;
  title_ar: string;
  title_en: string;
  dueDate: string;
  registrationDeadlineHours: string;
  registrationDeadlineEnabled?: boolean;
  /**
   * Both modes keep these populated — the first and last day the opportunity
   * runs — so every existing date rule, sort and card keeps working. What
   * separates the two is `scheduleDates`. See `OpportunityScheduleDates`.
   */
  startDate: string;
  endDate: string;
  scheduleMode: ScheduleMode;
  scheduleDates: string[];
  participantsNeeded: string;
  age: [number | null, number | null];
  startTime: string;
  endTime: string;
  volunteerHoursPerDay: string;
  gender: string;
  location: string;
  /** A shared maps URL — the quick path, and the one most organisers use. */
  locationUrl: string;
  link: string;
  isPrivate?: string;
  description_ar: string;
  description_en: string;
  _interests: string[];
  opportunity_images: File[];
  license_image?: File | string;
  latitude: string;
  longitude: string;
  sponsors: { sponsorId: string; position: number }[];
  volunteerCategory: string;
  beneficiariesCount: string;
  /** BE-77 — the four-way audience that replaced the "Kuwaitis only" tick. */
  opportunity_nationality: string;
  /** BE-101 — self check-in must be scanned within the radius of the map pin. */
  requiresAttendanceLocation: boolean;
}

export interface VolunteerFormProps {
  autoSetTimeOnClick?: boolean; // Auto-set time fields to 12:00 on first click
}

// Leaflet touches `window` at import time, so it can't be part of the SSR pass.
