/** Shapes lifted out of `ProfileEventCard`. */

import { type FiltersData } from "@/features/profile/components/profileFilters";
import type { User } from "@/store/authStore";
import type { EventRecord } from "@/features/events/eventRecord";

/**
 * The event rows this screen renders.
 *
 * It is `EventRecord` — the transcription of `WebsiteEventResource` — rather
 * than a local shape. The local one declared `title_en: string`,
 * `start_date: string`, `event_images: Array<{ image: string }>` and
 * `participants_needed: number`; every one of those columns is **nullable** in
 * the migration, and three sibling copies of this interface had each drifted to
 * a different subset. Reading the real record means a null arrives as a type
 * error here instead of as `null.slice(...)` at runtime.
 */
export type EventData = EventRecord;

export interface ProfileEventCardProps {
  filter_type: "myevents" | "organized_events" | "sponsored_events";
  filters: FiltersData;
  searchQuery: string;
  /**
   * 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;
  isPublicProfile?: boolean;
  user_id?: string;
}
