/* eslint-disable max-len */
import React from 'react';
import PropTypes from 'prop-types';
import { withTranslation } from 'react-i18next';
import { createSubscribedElement } from '../../UnstatedUtils';
import AppContainer from '../../../services/AppContainer';
class WhiteListInput extends React.Component {
renderRecommendBtn() {
const { t } = this.props;
return (
{ t('markdown_setting.import_recommended', 'tags') }
);
}
render() {
const { t, customizable } = this.props;
const { onChangeTagWhiteList, onChangeAttrWhiteList } = this.props;
return (
<>
{ t('markdown_setting.Tag names') }
{customizable && this.renderRecommendBtn()}
{/* TODO GW-304 fetch correct defaultValue */}
{ t('markdown_setting.Tag attributes') }
{customizable && this.renderRecommendBtn()}
{/* TODO GW-304 fetch correct defaultValue */}
>
);
}
}
const WhiteListWrapper = (props) => {
return createSubscribedElement(WhiteListInput, props, [AppContainer]);
};
WhiteListInput.propTypes = {
t: PropTypes.func.isRequired, // i18next
appContainer: PropTypes.instanceOf(AppContainer).isRequired,
customizable: PropTypes.bool.isRequired,
onChangeTagWhiteList: PropTypes.func,
onChangeAttrWhiteList: PropTypes.func,
};
export default withTranslation()(WhiteListWrapper);