import React from 'react'; import PropTypes from 'prop-types'; import { Modal, ModalBody } from 'reactstrap'; import { Utils } from '../../utils/utils'; const propTypes = { currentPerm: PropTypes.string.isRequired, permissions: PropTypes.array.isRequired, changePerm: PropTypes.func.isRequired, toggleDialog: PropTypes.func.isRequired }; class ShareLinkPermissionSelect extends React.Component { constructor(props) { super(props); this.state = { currentOption: this.props.currentPerm }; } switchOption = (e) => { if (!e.target.checked) { return; } const currentOption = e.target.value; this.setState({ currentOption: currentOption }); this.props.changePerm(currentOption); this.props.toggleDialog(); }; render() { const options = this.props.permissions; const { currentOption } = this.state; return ( {options.map((item, index) => { return (
); })}
); } } ShareLinkPermissionSelect.propTypes = propTypes; export default ShareLinkPermissionSelect;