2021-03-12 05:23:46 -05:00
|
|
|
import PropTypes from 'prop-types'
|
2023-10-19 04:33:26 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
export default function MemberPrivileges({ privileges }) {
|
2023-10-19 04:33:26 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
2021-03-12 05:23:46 -05:00
|
|
|
switch (privileges) {
|
|
|
|
case 'readAndWrite':
|
2023-10-19 04:33:26 -04:00
|
|
|
return t('can_edit')
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
case 'readOnly':
|
2023-10-19 04:33:26 -04:00
|
|
|
return t('read_only')
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
default:
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MemberPrivileges.propTypes = {
|
2021-04-27 03:52:58 -04:00
|
|
|
privileges: PropTypes.string.isRequired,
|
2021-03-12 05:23:46 -05:00
|
|
|
}
|