import { Color } from '@ionic/core'; import { AvatarMetadata } from '../../atoms/avatar/types'; /** * Author information for a comment. */ export interface CommentAuthor { /** Display name */ name: string; /** Username handle (without @) */ username?: string; /** Author avatar configuration */ avatar?: AvatarMetadata; /** Whether user is verified */ verified?: boolean; /** Optional user ID or reference */ userId?: string; } /** * Reaction configuration (like, love, laugh, etc.) */ export interface CommentReaction { /** Unique identifier for this reaction type */ token: string; /** Icon name (ionicon) */ icon: string; /** Reaction count */ count: number; /** Whether current user has reacted */ active?: boolean; /** Icon color when active */ activeColor?: Color; /** Icon color when inactive */ color?: Color; /** Label for accessibility */ label?: string; } /** * Action button configuration (reply, share, etc.) */ export interface CommentAction { /** Unique identifier */ token: string; /** Action label */ label: string; /** Optional icon */ icon?: string; /** Button color */ color?: Color; /** Whether action is disabled */ disabled?: boolean; /** Reactive content key */ contentKey?: string; /** Component class for content lookup */ contentClass?: string; /** Fallback label */ contentFallback?: string; } /** * Menu item for the "more" dropdown (edit, delete, report, etc.) */ export interface CommentMenuItem { /** Unique identifier */ token: string; /** Menu item label */ label: string; /** Optional icon */ icon?: string; /** Item color (danger for delete, etc.) */ color?: Color; /** Whether item is disabled */ disabled?: boolean; /** Whether to show a divider before this item */ dividerBefore?: boolean; /** Reactive content key */ contentKey?: string; /** Component class for content lookup */ contentClass?: string; /** Fallback label */ contentFallback?: string; } /** * Main comment metadata interface. * Supports recursive nesting via children property. */ export interface CommentMetadata { /** Unique comment identifier */ token: string; /** Comment author */ author: CommentAuthor; /** Comment text content */ content: string; /** Timestamp - can be string ("2 hours ago") or Date object */ timestamp: string | Date; /** Available reactions */ reactions?: CommentReaction[]; /** Action buttons (reply, etc.) */ actions?: CommentAction[]; /** Menu items for "more" dropdown */ menuItems?: CommentMenuItem[]; /** Nested child comments (replies) */ children?: CommentMetadata[]; /** Whether comment was edited */ edited?: boolean; /** Whether comment is pinned */ pinned?: boolean; /** Whether comment is highlighted */ highlighted?: boolean; /** Whether comment is collapsed */ collapsed?: boolean; /** Total reply count (may differ from children.length if paginated) */ replyCount?: number; /** Whether to auto-linkify URLs in content */ autoLinkify?: boolean; /** Maximum nesting depth (default: 3) */ maxDepth?: number; /** Current depth level (internal use) */ depth?: number; /** Reactive content key for main content */ contentKey?: string; /** Component class for content lookup */ contentClass?: string; /** Fallback content */ contentFallback?: string; } /** * Event emitted when author is clicked. */ export interface CommentAuthorClickEvent { /** The author that was clicked */ author: CommentAuthor; /** Parent comment token */ commentToken: string; } /** * Event emitted when a reaction is clicked. */ export interface CommentReactionClickEvent { /** The reaction that was clicked */ reaction: CommentReaction; /** Parent comment token */ commentToken: string; /** Whether reaction is now active */ isActive: boolean; } /** * Event emitted when an action is clicked. */ export interface CommentActionClickEvent { /** The action that was clicked */ action: CommentAction; /** Parent comment token */ commentToken: string; } /** * Event emitted when a menu item is clicked. */ export interface CommentMenuItemClickEvent { /** The menu item that was clicked */ menuItem: CommentMenuItem; /** Parent comment token */ commentToken: string; } /** * Event emitted when load more replies is clicked. */ export interface CommentLoadMoreEvent { /** Parent comment token */ commentToken: string; /** Current loaded count */ currentCount: number; }