// @flow import * as ICONS from 'constants/icons'; import Button from 'component/button'; import Comment from 'component/comment'; import React from 'react'; import Spinner from 'component/spinner'; type Props = { fetchedReplies: Array, uri: string, parentId: string, claimIsMine: boolean, myChannels: ?Array, linkedCommentId?: string, userCanComment: boolean, threadDepth: number, numDirectReplies: number, // Total replies for parentId as reported by 'comment[replies]'. Includes blocked items. isFetchingByParentId: { [string]: boolean }, hasMore: boolean, supportDisabled: boolean, onShowMore?: () => void, }; function CommentsReplies(props: Props) { const { uri, parentId, fetchedReplies, claimIsMine, myChannels, linkedCommentId, userCanComment, threadDepth, numDirectReplies, isFetchingByParentId, hasMore, supportDisabled, onShowMore, } = props; const [isExpanded, setExpanded] = React.useState(true); return !numDirectReplies ? null : (
{!isExpanded ? (
) : (
)} {isExpanded && fetchedReplies && hasMore && (
)} {isFetchingByParentId[parentId] && (
)}
); } export default CommentsReplies;