overleaf/services/web/frontend/js/features/share-project-modal/components/member-privileges.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

20 lines
416 B
JavaScript

import PropTypes from 'prop-types'
import { useTranslation } from 'react-i18next'
export default function MemberPrivileges({ privileges }) {
const { t } = useTranslation()
switch (privileges) {
case 'readAndWrite':
return t('can_edit')
case 'readOnly':
return t('read_only')
default:
return null
}
}
MemberPrivileges.propTypes = {
privileges: PropTypes.string.isRequired,
}