import {
  Attachment,
  ExternalReference,
  GifAttachment,
} from '@interfaces/attachments';
import {BodyAttributes} from '@interfaces/bodyAttributes';
import {SetState} from '@interfaces/generic';
import {LinkPreviewsBodyParam} from '@interfaces/linkPreview';
import {PollConfiguration} from '@modules/post/interfaces';

export type DraftState = {
  messageBody: string;
  images: Attachment[];
  videos: Attachment[];
  files: Attachment[];
  gif: Nullable<GifAttachment>;
  taggedUsers: BodyAttributes[];
  linkPreviews?: LinkPreviewsBodyParam;
  segmentationItemIds: number[];
  hasPoll: boolean;
  pollOptions: string[];
  pollConfiguration: PollConfiguration;
};

export type HandlePublishProps = {
  publicationDatetime?: string | Date;
  sendPushNotification?: boolean;
};

export type DeleteAttachmentType = {
  key: string;
  value?: Nullable<string | number | ExternalReference>;
  setThings: SetState<Attachment[]>;
  setOtherThings: SetState<Attachment[]>;
};

export type AttachmentsData = {
  attachmentsSize: number;
  initialImages: Attachment[];
  images: Attachment[];
  initialVideos: Attachment[];
  videos: Attachment[];
  initialFiles: Attachment[];
  files: Attachment[];
  initialGif: Nullable<GifAttachment>;
  gif: Nullable<GifAttachment>;
};

export interface GetUsersAudienceParams {
  page: number;
  limit: number;
  includeLoggedUser: boolean;
  segmentationItemIds: string;
}
