import React from 'react'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import cn from 'classnames'; import SectionTitle from './SectionTitle'; function Comments() { const { bugReportStore } = useStore(); const inputRef = React.createRef(); const toggleEdit = () => { bugReportStore.toggleCommentEditing(true); }; React.useEffect(() => { if (inputRef.current && bugReportStore.isCommentEdit) { inputRef.current?.focus(); } }, [bugReportStore.isCommentEdit]); const commentsEnabled = bugReportStore.comment.length > 0; const commentStr = commentsEnabled ? bugReportStore.comment : 'Expected results, additional steps or any other useful information for debugging.'; return (
Comments
(Optional)
{bugReportStore.isCommentEdit ? (