import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import { withUnstatedContainers } from '../../UnstatedUtils'; import { tags, attrs } from '~/services/xss/recommended-whitelist'; import AppContainer from '~/client/services/AppContainer'; import AdminMarkDownContainer from '~/client/services/AdminMarkDownContainer'; class WhiteListInput extends React.Component { constructor(props) { super(props); this.tagWhiteList = React.createRef(); this.attrWhiteList = React.createRef(); this.onClickRecommendTagButton = this.onClickRecommendTagButton.bind(this); this.onClickRecommendAttrButton = this.onClickRecommendAttrButton.bind(this); } onClickRecommendTagButton() { this.tagWhiteList.current.value = tags; this.props.adminMarkDownContainer.setState({ tagWhiteList: tags }); } onClickRecommendAttrButton() { this.attrWhiteList.current.value = attrs; this.props.adminMarkDownContainer.setState({ attrWhiteList: attrs }); } render() { const { t, adminMarkDownContainer } = this.props; return ( <>
{t('admin:markdown_setting.xss_options.tag_names')}

{t('admin:markdown_setting.xss_options.import_recommended', { target: 'Tags' })}