/** Shapes and constants lifted out of the component of the same name. */

import type { User } from "@/store/authStore";

export interface EventImage {
  image: string;
}

export interface EventData {
  id: number;
  event_images: EventImage[];
  cover_image?: string | null;
  title_en: string;
  title_ar: string;
  start_date: string;
  end_date: string;
  start_time: string;
  end_time: string;
  registration_required: boolean;
  registered_volunteers_count: number;
  participants_needed: number;
  event_status?: string;
  due_date: string;
  view_count: number;
  participation_type_display?: { value_en: string; value_ar: string };
  /** Detail payload only today — see `EventPaidBadge` (BE-139). */
  paid_registration?: boolean | null;
  registration_fee?: number | string | null;
  event_type_display?: { value_en: string; value_ar: string };
  interest_display?: Array<{ value_en: string; value_ar: string }>;
  created_by?: { id: number };
  location_en?: string;
  location_ar?: string;
  /** Pin label (`map_desc ?: location_ar ?: location_en`); the only place text for new events. */
  map_desc?: string | null;
}

export interface EventCardProps {
  events: EventData[] | undefined;
  onNavigationVisibilityChange?: (isVisible: boolean) => void;
  is_homepage?: boolean;
  /**
   * The signed-in user from `authStore`, for the creator / registration checks.
   *
   * `User | null` rather than `any`: only `id` and `user_type` are ever read off
   * it across the four card families, and both are declared on `User`. It was
   * `any` because the card types predate that interface, not because the shape
   * is unknown.
   */
  currentUser?: User | null;
  refetch?: () => void;
}

// Four across on wide screens, matching the volunteer and learn & serve
// carousels. Both the client query and the server prefetch pull 6 events, so
// there is still a second page to scroll to at this width.
export { homeCarouselResponsive as responsive } from "./homeCarouselLayout";
