import React, { FC, useCallback, useState } from 'react' import { useTranslation, Trans } from 'react-i18next' import { ThreadId } from '../../../../../types/review-panel/review-panel' import { useThreadsActionsContext } from '../context/threads-context' import OLTooltip from '@/features/ui/components/ol/ol-tooltip' import MaterialIcon from '@/shared/components/material-icon' import { ExpandableContent } from './review-panel-expandable-content' import { ReviewPanelCommentContent } from './review-panel-comment-content' import { Change, CommentOperation } from '../../../../../types/change' import classNames from 'classnames' import { debugConsole } from '@/utils/debugging' import { useModalsContext } from '@/features/ide-react/context/modals-context' export const ReviewPanelResolvedThread: FC<{ id: ThreadId comment: Change docName: string }> = ({ id, comment, docName }) => { const { t } = useTranslation() const { reopenThread, deleteThread } = useThreadsActionsContext() const [processing, setProcessing] = useState(false) const { showGenericMessageModal } = useModalsContext() const handleReopenThread = useCallback(async () => { setProcessing(true) try { await reopenThread(id) } catch (err) { debugConsole.error(err) showGenericMessageModal( t('reopen_comment_error_title'), t('reopen_comment_error_message') ) } finally { setProcessing(false) } }, [id, reopenThread, showGenericMessageModal, t]) const handleDeleteThread = useCallback(async () => { setProcessing(true) try { await deleteThread(id) } catch (err) { debugConsole.error(err) showGenericMessageModal( t('delete_comment_error_title'), t('delete_comment_error_message') ) } finally { setProcessing(false) } }, [id, deleteThread, showGenericMessageModal, t]) return (
, ]} values={{ filename: docName }} shouldUnescape tOptions={{ interpolation: { escapeValue: true } }} />
{t('quoted_text')}
{comment?.op.c}
) }