import { Sort as SortPrimitive } from '@wix/headless-components/react';
import { AsChildChildren } from '@wix/headless-utils/react';
import React from 'react';
import { type CommentsServiceConfig, type QueryCommentsSort } from '../services/comments-service.js';
export interface CommentsRootProps {
asChild?: boolean;
className?: string;
children: AsChildChildren<{
hasComments: boolean;
}> | React.ReactNode;
currentMember?: unknown;
commentsServiceConfig: CommentsServiceConfig;
}
/**
* Root container for comments that provides comments context to all child components.
* Uses IntersectionObserver for lazy loading - comments are loaded when the container becomes visible.
*
* @component
* @example
* ```tsx
* import { Blog, Comment } from '@wix/blog/components';
*
* function CommentsSection() {
* return (
*
*
*
*
*
*
* );
* }
* ```
*/
export declare const Root: React.ForwardRefExoticComponent>;
export interface CommentItemsProps {
children: React.ReactNode;
className?: string;
emptyState?: React.ReactNode;
loadingState?: React.ReactNode;
}
/**
* Container for the comments list with empty state support.
* Follows List Container Level pattern from architecture rules.
*
* @component
* @example
* ```tsx
* No comments yet}>
*
*
*
*
*
* ```
*/
export declare const CommentItems: React.ForwardRefExoticComponent>;
export interface SortProps {
/**
* Render function that provides sort state and controls when using asChild pattern.
* Only called when asChild is true and children is provided.
*
* @param props.currentSort - Current sort configuration from Wix Comments API
* @param props.sortOptions - Available sort options with field names and labels
* @param props.setSort - Function to update the sort configuration
*
* @example
* ```tsx
*
* {({ currentSort, sortOptions, setSort }) => (
*
* )}
*
* ```
*/
children?: (props: {
currentSort: QueryCommentsSort[];
sortOptions: SortPrimitive.SortOption[];
setSort: (sort: QueryCommentsSort[]) => void;
}) => React.ReactNode;
/**
* CSS classes to apply to the sort component.
* Only used when asChild is false (default rendering).
*/
className?: string;
/**
* Render mode for the default sort component.
* - 'select': Renders as HTML select dropdown
* - 'list': Renders as clickable list of options
*
* @default 'select'
*/
as?: 'select' | 'list';
/**
* When true, the component uses the asChild pattern and delegates
* rendering to the children render function. When false (default),
* renders the built-in Sort.Root component.
*
* @default false
*/
asChild?: boolean;
}
/**
* Sort component for comments that provides sorting functionality.
*
* @component
* @example
* ```tsx
* // Default select dropdown
*
*
* // As list of clickable options
*
*
* // With custom styling
*
* ```
*/
export declare const Sort: React.ForwardRefExoticComponent>;
export interface CommentItemRepeaterProps {
children: React.ReactNode;
}
/**
* Repeater component that creates individual comment contexts for each comment.
* Follows Repeater Level pattern from architecture rules.
* Note: Repeater components do NOT support asChild as per architecture rules.
*
* @component
* @example
* ```tsx
*
*
*
*
*
* ```
*/
export declare const CommentItemRepeater: React.ForwardRefExoticComponent>;
export interface LoadMoreProps {
asChild?: boolean;
className?: string;
loadingState?: React.ReactNode;
children?: AsChildChildren<{
isLoading: boolean;
loadNextPage: () => Promise;
}> | React.ReactNode;
}
/**
* Load more trigger component for pagination.
*
* @component
* @example
* ```tsx
*
* {({ hasNextPage, isLoading, loadNextPage }) => (
*
* )}
*
* ```
*/
export declare const LoadMore: React.ForwardRefExoticComponent>;