overleaf/services/web/frontend/js/features/share-project-modal/components/send-invites-notice.js
Alf Eaton 7c97f8ab6e Switch to new JSX runtime (#4225)
* Use new JSX runtime and update Babel Node target
* Update .eslintrc
* Remove React imports

GitOrigin-RevId: 559de0267f8f2934c56a860ea8701bb522aa861a
2021-06-24 02:06:59 +00:00

32 lines
784 B
JavaScript

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