import React from 'react'; import { func, string } from 'prop-types'; import { Button } from '@patternfly/react-core'; import { I18n, i18nMark } from '@lingui/react'; import { t, Trans } from '@lingui/macro'; import AlertModal from '../../../components/AlertModal'; import { Role } from '../../../types'; class DeleteRoleConfirmationModal extends React.Component { static propTypes = { role: Role.isRequired, username: string, onCancel: func.isRequired, onConfirm: func.isRequired, } static defaultProps = { username: '', } isTeamRole () { const { role } = this.props; return typeof role.team_id !== 'undefined'; } render () { const { role, username, onCancel, onConfirm } = this.props; const title = `Remove ${this.isTeamRole() ? 'Team' : 'User'} Access`; return ( {({ i18n }) => ( {i18n._(t`Delete`)} , ]} > {this.isTeamRole() ? ( Are you sure you want to remove {` ${role.name} `} access from {` ${role.team_name}`} ? Doing so affects all members of the team.

If you only want to remove access for this particular user, please remove them from the team.
) : ( Are you sure you want to remove {` ${role.name} `} access from {` ${username}`} ? )}
)}
); } } export default DeleteRoleConfirmationModal;