UNPKG

@desci-labs/frontend-components

Version:

A library for commonly used components on the DeSci Frontend web apps

33 lines 1.75 kB
import { ClaimComment } from '../interfaces'; import { ReactNode } from 'react'; interface CommentProps { /** All the comments to be displayed */ comments: ClaimComment[]; /** The user id of the logged in user */ loggedInUserId: number; /** The theme of page */ theme: "light" | "dark"; /** The function to handle the edit comment */ handleEditComment?: (comment: ClaimComment) => void; /** The function to handle the delete comment */ handleDeleteComment: (comment: ClaimComment) => Promise<void>; /** The component to display for highlights */ highlightBlock?: ReactNode; /** The block to display for comments */ commentBlock?: ReactNode; /** The function to handle the upvote comment, takes in the comment */ handleUpvote: (comment: ClaimComment) => Promise<void>; /** The function to handle the downvote comment, takes in the comment */ handleDownvote: (comment: ClaimComment) => Promise<void>; /** Whether the user is signed in */ signedIn: boolean; /** The function to update the comment, takes in the comment id and the text */ updateComment: (commentId: number, text: string) => Promise<void>; /** Whether the comment is being edited, used to show the loader for update button */ isEditing: boolean; /** Whether the comment is being posted, used to disable the update button */ isPostingComment: boolean; } export declare const CommentDisplay: ({ comments, loggedInUserId, theme, handleEditComment, handleDeleteComment, highlightBlock, handleUpvote, handleDownvote, signedIn, updateComment, isEditing, isPostingComment, }: CommentProps) => import("react/jsx-runtime").JSX.Element; export {}; //# sourceMappingURL=CommentDisplay.d.ts.map