export type ForumTopic = {
  roomId: string;
  name: string;
  topic?: string;
  canonicalAlias?: string;
  memberCount?: number;
  isSpace: boolean;
  parentRoomId?: string;
};

export type ForumSection = {
  /** Child space room id when this section is a subspace; omitted for “General Topics”. */
  spaceId?: string;
  title: string;
  description: string | null;
  topics: ForumTopic[];
};

export type ForumPost = {
  eventId: string;
  title: string;
  body: string;
  bodyHtml?: string;
  sender: string;
  senderDisplayName?: string;
  timestamp: number;
  topicRoomId?: string;
  sectionTitle?: string;
  topicName?: string;
  bundledReplyCount?: number;
  replies: ForumPost[];
  replyToEventId?: string;
  replyToDeleted?: boolean;
};

export type ForumThreadSummary = {
  eventId: string;
  title: string;
  body: string;
  sender: string;
  senderDisplayName?: string;
  timestamp: number;
  topicRoomId?: string;
  sectionTitle?: string;
  topicName?: string;
  totalReplies: number;
  lastActivityTs: number;
  isPinned?: boolean;
};

export type ForumPublishedPost = {
  eventId: string;
  topicRoomId: string;
  title: string;
  plainText: string;
  formattedHtml: string;
};

export type ForumBoardQuery = {
  category?: string;
  topic?: string;
  post?: string;
  /** Room for the selected post (thread detail only; does not change filter dropdowns). */
  postRoom?: string;
  q?: string;
  status?: 'all' | 'open' | 'quiet';
  sort?: 'hot' | 'new' | 'top';
};
