import * as React from 'react'; import I18n from 'i18n-js'; import NewCommentUpdateSection from './NewCommentUpdateSection'; import Button from '../common/Button'; import Spinner from '../common/Spinner'; import { DangerText } from '../common/CustomTexts'; import { AttachIcon, CancelIcon, MarkdownIcon } from '../common/Icons'; import Avatar from '../common/Avatar'; import ActionLink from '../common/ActionLink'; import Dropzone from '../common/Dropzone'; interface Props { body: string; parentId: number; postUpdateFlagValue: boolean; isSubmitting: boolean; error: string; handleChange(e: React.FormEvent): void; handlePostUpdateFlag(): void; handleSubmit( body: string, parentId: number, isPostUpdate: boolean, attachments: File[], onSuccess: Function, ): void; allowAttachmentUpload: boolean; isLoggedIn: boolean; isPowerUser: boolean; userEmail: string; userAvatar?: string; } const NewComment = ({ body, parentId, postUpdateFlagValue, isSubmitting, error, handleChange, handlePostUpdateFlag, handleSubmit, allowAttachmentUpload, isLoggedIn, isPowerUser, userEmail, userAvatar, }: Props) => { const [isAttachingFiles, setIsAttachingFiles] = React.useState(false); const [attachments, setAttachments] = React.useState([]); return ( <>
{ isLoggedIn ? <>