Skip to content

Interface

ts

const widgetType = 'history' | 'comments' | 'files' | 'gallery' ;

interface Comment {
  id: string;
  entityId: string;          // ID of the related post, file, or item
  entityType: 'post' | 'file' | 'product' | 'custom'; // type of linked entity
  author: string;           // who posted the comment
  text: string;             // comment body
  createdAt: Date;
  updatedAt?: Date;         // optional if edited
  parentId?: string;        // for nested replies
  replies?: Comment[];      // child comments
  status: 'visible' | 'hidden' | 'deleted';  // moderation
  keywords?: string[];      // tags or search terms
  likes?: number;           // optional reaction count
}