import { Color } from '@ionic/core'; import { CommentMetadata, CommentAuthor } from '../../molecules/comment/types'; /** * Sort/filter option for comments. * The actual sorting logic is handled by the parent component. */ export interface CommentSortOption { /** Unique identifier */ token: string; /** Display label */ label: string; /** Optional icon */ icon?: string; /** Reactive content key */ contentKey?: string; /** Component class for content lookup */ contentClass?: string; /** Fallback label */ contentFallback?: string; } /** * Configuration for the new comment input area. */ export interface CommentInputConfig { /** Input placeholder text */ placeholder?: string; /** Submit button label */ submitLabel?: string; /** Current user info (for avatar display) */ currentUser?: CommentAuthor; /** Maximum character length */ maxLength?: number; /** Minimum character length to enable submit */ minLength?: number; /** Whether input is disabled */ disabled?: boolean; /** Submit button color */ submitColor?: Color; /** Show character counter */ showCounter?: boolean; /** Reactive content keys */ placeholderContentKey?: string; submitLabelContentKey?: string; contentClass?: string; } /** * Empty state configuration when no comments exist. */ export interface CommentEmptyState { /** Empty state title */ title?: string; /** Empty state message */ message?: string; /** Empty state icon */ icon?: string; /** Reactive content keys */ titleContentKey?: string; messageContentKey?: string; contentClass?: string; } /** * Main metadata for comment-section organism. */ export interface CommentSectionMetadata { /** Unique section identifier */ token?: string; /** Section title (e.g., "Comments", "Reviews") */ title?: string; /** Total comment count (may differ from comments.length if paginated) */ count?: number; /** Whether to show the count badge */ showCount?: boolean; /** Available sort options */ sortOptions?: CommentSortOption[]; /** Currently selected sort option token */ selectedSort?: string; /** Sort dropdown label */ sortLabel?: string; /** Array of comments to display */ comments: CommentMetadata[]; /** Whether to show the new comment input */ showInput?: boolean; /** Input configuration */ inputConfig?: CommentInputConfig; /** Initial loading state */ loading?: boolean; /** Loading more comments */ loadingMore?: boolean; /** Number of skeleton items to show when loading */ skeletonCount?: number; /** Whether there are more comments to load */ hasMore?: boolean; /** Load more button label */ loadMoreLabel?: string; /** Pagination mode: 'button' (default) or 'infinite' */ paginationMode?: 'button' | 'infinite'; /** Infinite scroll threshold (e.g., '100px', '15%') */ infiniteScrollThreshold?: string; /** Infinite scroll position */ infiniteScrollPosition?: 'top' | 'bottom'; /** Empty state configuration */ emptyState?: CommentEmptyState; /** Section color theme */ color?: Color; /** Whether to show dividers between comments */ showDividers?: boolean; /** Reactive content key for title */ titleContentKey?: string; /** Component class for content lookup */ contentClass?: string; /** Fallback title */ titleContentFallback?: string; /** Reactive content key for load more label */ loadMoreContentKey?: string; } /** * Event emitted when sort option changes. */ export interface CommentSortChangeEvent { /** Selected sort option */ option: CommentSortOption; /** Previous sort option token */ previousSort?: string; } /** * Event emitted when a new comment is submitted. */ export interface CommentSubmitEvent { /** Comment text content */ content: string; /** Parent comment token (if replying) */ parentToken?: string; /** Section token */ sectionToken?: string; } /** * Event emitted when load more is clicked. */ export interface CommentSectionLoadMoreEvent { /** Section token */ sectionToken?: string; /** Current loaded count */ currentCount: number; }