import React from 'react';
import PropTypes from 'prop-types';
import { Button, Modal, ModalBody, ModalFooter } from 'reactstrap';
import { Utils } from '../../../utils/utils';
import { gettext } from '../../../utils/constants';
import UserSelect from '../../user-select';
import SeahubModalHeader from '@/components/common/seahub-modal-header';
const propTypes = {
groupName: PropTypes.string.isRequired,
transferGroup: PropTypes.func.isRequired,
toggleDialog: PropTypes.func.isRequired
};
class SysAdminTransferGroupDialog extends React.Component {
constructor(props) {
super(props);
this.state = {
selectedOption: null,
submitBtnDisabled: true
};
}
handleSelectChange = (option) => {
this.setState({
selectedOption: option,
submitBtnDisabled: option == null
});
};
submit = () => {
const receiver = this.state.selectedOption.email;
this.props.transferGroup(receiver);
this.props.toggleDialog();
};
render() {
const { submitBtnDisabled } = this.state;
const groupName = '' + Utils.HTMLescape(this.props.groupName) + '';
const msg = gettext('Transfer Group {placeholder} to').replace('{placeholder}', groupName);
return (
);
}
}
SysAdminTransferGroupDialog.propTypes = propTypes;
export default SysAdminTransferGroupDialog;