import React from 'react'; import type { Comment } from '@pantheon-systems/css-client'; import type { ThreadContext, ThreadSubject } from '../types.js'; import type { MentionCandidate } from '../mentions.js'; import type { ProposalActions } from '../proposals.js'; export interface CommentThreadProps extends Pick { /** What to call the thing being discussed. Falls back to naming its kind. */ subject?: ThreadSubject; /** What has been said so far, oldest first. */ comments?: readonly Comment[]; /** The comments are on their way. */ loading?: boolean; /** The comments could not be loaded. */ failed?: boolean; /** Ask for the comments again, offered when they could not be loaded. */ onRetry?: () => void; /** * Called with the trimmed draft when the reader posts it. Absent when nothing can be * posted. May resolve to `false` to say the body did not land, which keeps the * draft in place for another try. */ onPost?: (body: string) => void | Promise; /** A post is in flight. */ posting?: boolean; /** The last post did not land. */ postFailed?: boolean; /** Who can be mentioned with `@`, agents first. Nobody, when absent. */ mentionCandidates?: readonly MentionCandidate[]; /** * Accepting and dismissing an agent's proposal. Refining one is handled here: the * comment goes to the thread, mentioning the agent that made the proposal. */ proposalActions?: Pick; /** Marks the discussion over. Absent where the reader cannot resolve it. */ onResolve?: () => void; /** The thread is being resolved. */ resolving?: boolean; /** The last attempt to resolve did not land. */ resolveFailed?: boolean; onClose: () => void; } /** * The thread about one piece of content. * * Opens beside the trigger it belongs to, with a caret pointing back at it, so a reader * can tell which piece of content is being discussed when several threads are in reach. * The header names that content outright, for when the caret alone is not enough. * * Shows what has been said so far and hands a new draft to whoever mounted the view; * loading the one and sending the other are the host's to do. */ export declare function CommentThread({ contextType, contextId, threadId, resolved, subject, comments, loading, failed, onRetry, onPost, posting, postFailed, mentionCandidates, proposalActions, onResolve, resolving, resolveFailed, onClose, }: CommentThreadProps): React.ReactElement;