// @flow import * as React from 'react'; import ActivityError from '../common/activity-error'; import ActivityThread from '../activity-feed/ActivityThread'; import AnnotationActivity from '../annotations'; import LoadingIndicator from '../../../../components/loading-indicator/LoadingIndicator'; import type { Annotation, AnnotationPermission, BoxCommentPermission, Comment, FeedItemStatus, } from '../../../../common/types/feed'; import type { SelectorItems, User } from '../../../../common/types/core'; import type { GetProfileUrlCallback } from '../../../common/flowTypes'; import type { AnnotationThreadError } from './types'; import './AnnotationThreadContent.scss'; import type { OnAnnotationEdit, OnAnnotationStatusChange } from '../comment/types'; type Props = { annotation?: Annotation, currentUser: User, error?: AnnotationThreadError, getAvatarUrl: string => Promise, getMentionWithQuery: (searchStr: string) => void, getUserProfileUrl?: GetProfileUrlCallback, isLoading: boolean, mentionSelectorContacts: SelectorItems<>, onAnnotationDelete?: ({ id: string, permissions: AnnotationPermission }) => any, onAnnotationEdit?: OnAnnotationEdit, onAnnotationStatusChange: OnAnnotationStatusChange, onReplyCreate?: (text: string) => void, onReplyDelete?: ({ id: string, permissions: BoxCommentPermission }) => void, onReplyEdit?: ( id: string, text: string, status?: FeedItemStatus, hasMention?: boolean, permissions: BoxCommentPermission, onSuccess: ?Function, onError: ?Function, ) => void, replies?: Array, }; const AnnotationThreadContent = ({ annotation, currentUser, error, getAvatarUrl, getMentionWithQuery, getUserProfileUrl, isLoading, mentionSelectorContacts, onAnnotationDelete, onAnnotationEdit, onAnnotationStatusChange, onReplyCreate, onReplyDelete, onReplyEdit, replies = [], }: Props) => { return ( <> {error && } {isLoading && (
)} {annotation && ( )} ); }; export default AnnotationThreadContent;