import {RequestAttachment} from '@interfaces/attachments';
import {BodyAttributes} from '@interfaces/bodyAttributes';
import {Comment} from '@interfaces/comments';
import {LinkPreview} from '@interfaces/linkPreview';
import {Poll} from '@interfaces/poll';
import {Reaction} from '@interfaces/reaction';
import {Group} from '@modules/group/interfaces';
import {PostStream} from '@modules/livestream/interfaces';
import {PostMetadata} from '@modules/post/interfaces';

export enum PostState {
  Posted = 'POSTED',
  Scheduled = 'SCHEDULED',
}

export type BasePost = {
  attachments: RequestAttachment[];
  body: string;
  bodyAttributes: BodyAttributes[];
  bodyHtml: Nullable<string>;
  commentCount: number;
  commentsEnabled: boolean;
  createdAt: string;
  id: number;
  lastComments: Nullable<Comment[]>;
  linkPreviews: Nullable<Record<string, Nullable<LinkPreview>>>;
  poll: Nullable<Poll>;
  publicationDatetime: string;
  reactions: Reaction[];
  sendNotification: boolean;
  state: PostState;
  user: {
    firstName: string;
    id: number;
    lastName: string;
    profilePicture: Nullable<string>;
  };
  pinned: boolean;
  stream: Nullable<PostStream>;
  group: Nullable<Group>;
  metadata: Nullable<PostMetadata>;
};
