/* eslint-disable react/no-danger */ import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import loggerFactory from '@alias/logger'; import { createSubscribedElement } from '../../UnstatedUtils'; import { toastSuccess, toastError } from '../../../util/apiNotification'; import AppContainer from '../../../services/AppContainer'; import MarkDownSettingContainer from '../../../services/MarkDownSettingContainer'; const logger = loggerFactory('growi:importer'); class LineBreakForm extends React.Component { constructor(props) { super(props); this.onClickSubmit = this.onClickSubmit.bind(this); } async onClickSubmit() { const { t } = this.props; try { await this.props.markDownSettingContainer.updateLineBreakSetting(); toastSuccess(t('markdown_setting.updated_lineBreak')); } catch (err) { toastError(err); logger.error(err); } } renderLineBreakOption() { const { t, markDownSettingContainer } = this.props; const { isEnabledLinebreaks } = markDownSettingContainer.state; const helpLineBreak = { __html: t('markdown_setting.Enable Line Break desc') }; return (