| | |
| | | onClick={() => setOpen(v => !v)} |
| | | className='block' |
| | | > |
| | | <div className={cn('flex cursor-pointer items-center rounded-lg bg-components-input-bg-normal px-3 py-2 hover:bg-state-base-hover', open && 'bg-state-base-hover')}> |
| | | <div className='mr-2 grow text-sm leading-5 text-text-primary'>{t('common.members.invitedAsRole', { role: t(`common.members.${toHump(value)}`) })}</div> |
| | | <RiArrowDownSLine className='h-4 w-4 shrink-0 text-text-secondary' /> |
| | | <div className={cn('flex items-center px-3 py-2 rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200', open && 'bg-gray-200')}> |
| | | <div className='grow mr-2 text-gray-900 text-sm leading-5'>{t('common.members.invitedAsRole', { role: t(`common.members.${toHump(value)}`) })}</div> |
| | | <RiArrowDownSLine className='shrink-0 w-4 h-4 text-gray-700' /> |
| | | </div> |
| | | </PortalToFollowElemTrigger> |
| | | <PortalToFollowElemContent className='z-[1002]'> |
| | | <div className='relative w-[336px] rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg'> |
| | | <div className='relative w-[336px] bg-white rounded-lg border-[0.5px] bg-gray-200 shadow-lg'> |
| | | <div className='p-1'> |
| | | <div className='cursor-pointer rounded-lg p-2 hover:bg-state-base-hover' onClick={() => { |
| | | <div className='p-2 rounded-lg hover:bg-gray-50 cursor-pointer' onClick={() => { |
| | | onChange('normal') |
| | | setOpen(false) |
| | | }}> |
| | | <div className='relative pl-5'> |
| | | <div className='text-sm leading-5 text-text-secondary'>{t('common.members.normal')}</div> |
| | | <div className='text-xs leading-[18px] text-text-tertiary'>{t('common.members.normalTip')}</div> |
| | | {value === 'normal' && <Check className='absolute left-0 top-0.5 h-4 w-4 text-text-accent'/>} |
| | | <div className='text-gray-700 text-sm leading-5'>{t('common.members.normal')}</div> |
| | | <div className='text-gray-500 text-xs leading-[18px]'>{t('common.members.normalTip')}</div> |
| | | {value === 'normal' && <Check className='absolute top-0.5 left-0 w-4 h-4 text-primary-600'/>} |
| | | </div> |
| | | </div> |
| | | <div className='cursor-pointer rounded-lg p-2 hover:bg-state-base-hover' onClick={() => { |
| | | <div className='p-2 rounded-lg hover:bg-gray-50 cursor-pointer' onClick={() => { |
| | | onChange('editor') |
| | | setOpen(false) |
| | | }}> |
| | | <div className='relative pl-5'> |
| | | <div className='text-sm leading-5 text-text-secondary'>{t('common.members.editor')}</div> |
| | | <div className='text-xs leading-[18px] text-text-tertiary'>{t('common.members.editorTip')}</div> |
| | | {value === 'editor' && <Check className='absolute left-0 top-0.5 h-4 w-4 text-text-accent'/>} |
| | | <div className='text-gray-700 text-sm leading-5'>{t('common.members.editor')}</div> |
| | | <div className='text-gray-500 text-xs leading-[18px]'>{t('common.members.editorTip')}</div> |
| | | {value === 'editor' && <Check className='absolute top-0.5 left-0 w-4 h-4 text-primary-600'/>} |
| | | </div> |
| | | </div> |
| | | <div className='cursor-pointer rounded-lg p-2 hover:bg-state-base-hover' onClick={() => { |
| | | <div className='p-2 rounded-lg hover:bg-gray-50 cursor-pointer' onClick={() => { |
| | | onChange('admin') |
| | | setOpen(false) |
| | | }}> |
| | | <div className='relative pl-5'> |
| | | <div className='text-sm leading-5 text-text-secondary'>{t('common.members.admin')}</div> |
| | | <div className='text-xs leading-[18px] text-text-tertiary'>{t('common.members.adminTip')}</div> |
| | | {value === 'admin' && <Check className='absolute left-0 top-0.5 h-4 w-4 text-text-accent'/>} |
| | | <div className='text-gray-700 text-sm leading-5'>{t('common.members.admin')}</div> |
| | | <div className='text-gray-500 text-xs leading-[18px]'>{t('common.members.adminTip')}</div> |
| | | {value === 'admin' && <Check className='absolute top-0.5 left-0 w-4 h-4 text-primary-600'/>} |
| | | </div> |
| | | </div> |
| | | {datasetOperatorEnabled && ( |
| | | <div className='cursor-pointer rounded-lg p-2 hover:bg-state-base-hover' onClick={() => { |
| | | <div className='p-2 rounded-lg hover:bg-gray-50 cursor-pointer' onClick={() => { |
| | | onChange('dataset_operator') |
| | | setOpen(false) |
| | | }}> |
| | | <div className='relative pl-5'> |
| | | <div className='text-sm leading-5 text-text-secondary'>{t('common.members.datasetOperator')}</div> |
| | | <div className='text-xs leading-[18px] text-text-tertiary'>{t('common.members.datasetOperatorTip')}</div> |
| | | {value === 'dataset_operator' && <Check className='absolute left-0 top-0.5 h-4 w-4 text-text-accent'/>} |
| | | <div className='text-gray-700 text-sm leading-5'>{t('common.members.datasetOperator')}</div> |
| | | <div className='text-gray-500 text-xs leading-[18px]'>{t('common.members.datasetOperatorTip')}</div> |
| | | {value === 'dataset_operator' && <Check className='absolute top-0.5 left-0 w-4 h-4 text-primary-600'/>} |
| | | </div> |
| | | </div> |
| | | )} |