platform-bible-react
    Preparing search index...

    Interface CommentListProps

    Props for the CommentList component

    interface CommentListProps {
        assignableUsers?: string[];
        canUserAddCommentToThread?: boolean;
        canUserAssignThreadCallback?: (threadId: string) => Promise<boolean>;
        canUserEditOrDeleteCommentCallback?: (
            commentId: string,
        ) => Promise<boolean>;
        canUserResolveThreadCallback?: (threadId: string) => Promise<boolean>;
        className?: string;
        classNameForVerseText?: string;
        currentUser: string;
        handleAddCommentToThread: (
            options: AddCommentToThreadOptions,
        ) => Promise<undefined | string>;
        handleDeleteComment: (commentId: string) => Promise<boolean>;
        handleReadStatusChange: (
            threadId: string,
            markRead: boolean,
        ) => Promise<boolean>;
        handleUpdateComment: (
            commentId: string,
            contents: string,
        ) => Promise<boolean>;
        localizedStrings: LanguageStrings;
        onSelectedThreadChange?: (threadId: undefined | string) => void;
        selectedThreadId?: string;
        threads: LegacyCommentThread[];
    }
    Index

    Properties

    assignableUsers?: string[]

    Users that can be assigned to threads. Includes special values: "Team" for team assignment, "" (empty string) for unassigned.

    canUserAddCommentToThread?: boolean

    Whether the current user can add comments to existing threads in this project. When false, UI elements for adding comments to threads should be hidden or disabled.

    canUserAssignThreadCallback?: (threadId: string) => Promise<boolean>

    Callback to check if the current user can assign a specific thread. Returns a promise that resolves to true if the user can assign the thread, false otherwise.

    canUserEditOrDeleteCommentCallback?: (commentId: string) => Promise<boolean>

    Callback to check if the current user can edit or delete a specific comment. Returns a promise that resolves to true if the user can edit or delete the comment, false otherwise.

    canUserResolveThreadCallback?: (threadId: string) => Promise<boolean>

    Callback to check if the current user can resolve or re-open a specific thread. Returns a promise that resolves to true if the user can resolve the thread, false otherwise.

    className?: string

    Additional class name for the component

    classNameForVerseText?: string

    Class name to apply to the display of the verse text for the first comment in the thread

    currentUser: string

    Name of the current user, retrieved from the current user's Paratext Registry user information

    handleAddCommentToThread: (
        options: AddCommentToThreadOptions,
    ) => Promise<undefined | string>

    Handler for adding a comment to a thread. This unified handler supports:

    • Adding a comment (provide contents)
    • Resolving/unresolving a thread (provide status: 'Resolved' or 'Todo')
    • Assigning a user (provide assignedUser)
    • Any combination of the above

    If successful, returns the auto-generated comment ID (format: "threadId/userName/date"). Otherwise, returns undefined.

    handleDeleteComment: (commentId: string) => Promise<boolean>

    Handler for deleting a comment

    handleReadStatusChange: (
        threadId: string,
        markRead: boolean,
    ) => Promise<boolean>

    Handler for updating a thread's read status

    handleUpdateComment: (commentId: string, contents: string) => Promise<boolean>

    Handler for updating a comment's content

    localizedStrings: LanguageStrings

    Localized strings for the component

    onSelectedThreadChange?: (threadId: undefined | string) => void

    Callback when the selected thread changes. Called when a thread is selected via click or keyboard navigation. Parent components can use this to sync their state with the internal selection.

    selectedThreadId?: string

    Externally controlled selected thread ID. When provided, this will be used as the selected thread instead of internal state. The parent component is responsible for updating this value when the selection changes.

    threads: LegacyCommentThread[]

    Comment threads to render