import React from 'react'; import PropTypes from 'prop-types'; // eslint-disable-next-line no-unused-vars import { withTranslation } from 'react-i18next'; import GrowiZipImportOption from '../../../models/GrowiZipImportOption'; export const DEFAULT_MODE = 'insert'; export default class GrowiZipImportItem extends React.Component { constructor(props) { super(props); this.changeHandler = this.changeHandler.bind(this); this.modeSelectedHandler = this.modeSelectedHandler.bind(this); } get currentModeLabel() { const { option } = this.props; const { mode } = option; // convert 'insert' -> 'Insert' return mode.substring(0, 1).toUpperCase() + mode.substring(1); } changeHandler(e) { const { collectionName, onChange } = this.props; if (onChange != null) { onChange(collectionName, e.target.checked); } } modeSelectedHandler(mode) { const { collectionName, onOptionChange } = this.props; if (onOptionChange == null) { return; } const { option } = this.props; option.mode = mode; onOptionChange(collectionName, option); } renderControls() { const { collectionName, isSelected, } = this.props; return (