import { Attachment } from 'src/types/attachments';
import { Reaction } from 'src/types/reaction';
import { User } from 'src/types/user';
import { TaggedUser } from 'src/types/user';

import { Links } from './actionLinks';

export type Comment = {
  id: number;
  bodyAttributes?: TaggedUser[];
  body: string;
  user: User;
  updatedAt: Date;
  createdAt: Date;
  attachments: Attachment[];
  reactions: Reaction[];
  parentId: number | null;
  lastChildComment?: Comment;
  children?: Comment[];
  childrenNumber?: number;
  isExternal: boolean;
  _links?: Links;
};

export type PostCommentPayload = {
  bodyAttributes?: TaggedUser[];
  taggedUserIds?: number[];
  linkPreviews?: any;
  parentId?: number;
  body: string;
  attachments: Attachment[];
};
