overleaf/services/web/frontend/js/features/share-project-modal/components/send-invites-notice.jsx
Alf Eaton 7755203ff7 Enable ESLint rule that enforces t when preferable to Trans (#15253)
GitOrigin-RevId: d11b3f587b462d400a8d68128dc8be342415bf7d
2023-10-20 08:03:34 +00:00

33 lines
821 B
JavaScript

import { Col, Row } from 'react-bootstrap'
import PropTypes from 'prop-types'
import { useTranslation } from 'react-i18next'
import { useProjectContext } from '../../../shared/context/project-context'
export default function SendInvitesNotice() {
const { publicAccessLevel } = useProjectContext()
return (
<Row className="public-access-level public-access-level--notice">
<Col xs={12} className="text-center">
<AccessLevel level={publicAccessLevel} />
</Col>
</Row>
)
}
function AccessLevel({ level }) {
const { t } = useTranslation()
switch (level) {
case 'private':
return t('to_add_more_collaborators')
case 'tokenBased':
return t('to_change_access_permissions')
default:
return null
}
}
AccessLevel.propTypes = {
level: PropTypes.string,
}