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;
        currentUser: string;
        handleAddCommentToThread: (
            options: AddCommentToThreadOptions,
        ) => Promise<undefined | string>;
        handleDeleteComment: (commentId: string) => Promise<boolean>;
        handleUpdateComment: (
            commentId: string,
            contents: string,
        ) => Promise<boolean>;
        localizedStrings: LanguageStrings;
        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

    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

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

    Handler for updating a comment's content

    localizedStrings: LanguageStrings

    Localized strings for the component

    threads: LegacyCommentThread[]

    Comment threads to render