// @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 = { uri: string, linkedCommentId?: string, threadDepth: number, numDirectReplies: number, // Total replies for parentId as reported by 'comment[replies]'. Includes blocked items. hasMore: boolean, supportDisabled: boolean, onShowMore?: () => void, // redux fetchedReplies: Array, claimIsMine: boolean, isFetching: boolean, }; export default function CommentsReplies(props: Props) { const { uri, fetchedReplies, claimIsMine, linkedCommentId, threadDepth, numDirectReplies, isFetching, hasMore, supportDisabled, onShowMore, } = props; const [isExpanded, setExpanded] = React.useState(true); return !numDirectReplies ? null : (
{!isExpanded ? (
) : (
{fetchedReplies.length > 0 && (
)} {isExpanded && fetchedReplies && hasMore && (
)} {isFetching && (
)}
); }