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-06-25 04:13:17 -04:00
|
|
|
import { useProjectContext } from '../../../shared/context/project-context'
|
2024-10-09 08:13:50 -04:00
|
|
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
|
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
export default function SendInvitesNotice() {
|
2022-01-10 10:47:10 -05:00
|
|
|
const { publicAccessLevel } = useProjectContext()
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
return (
|
2024-10-09 08:13:50 -04:00
|
|
|
<OLRow className="public-access-level public-access-level-notice">
|
|
|
|
<OLCol className="text-center">
|
2022-01-10 10:47:10 -05:00
|
|
|
<AccessLevel level={publicAccessLevel} />
|
2024-10-09 08:13:50 -04:00
|
|
|
</OLCol>
|
|
|
|
</OLRow>
|
2021-03-12 05:23:46 -05:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function AccessLevel({ level }) {
|
2023-10-19 04:33:26 -04:00
|
|
|
const { t } = useTranslation()
|
2021-03-12 05:23:46 -05:00
|
|
|
switch (level) {
|
|
|
|
case 'private':
|
2023-10-19 04:33:26 -04:00
|
|
|
return t('to_add_more_collaborators')
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
case 'tokenBased':
|
2023-10-19 04:33:26 -04:00
|
|
|
return t('to_change_access_permissions')
|
2021-03-12 05:23:46 -05:00
|
|
|
|
|
|
|
default:
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
AccessLevel.propTypes = {
|
2021-04-27 03:52:58 -04:00
|
|
|
level: PropTypes.string,
|
2021-03-12 05:23:46 -05:00
|
|
|
}
|