import React from 'react'; import { FormattedMessage as T, useIntl } from 'react-intl'; import { Intent, Button, Popover, Menu, MenuDivider, Tag, MenuItem, Position, } from '@blueprintjs/core'; import { safeCallback, firstLettersArgs } from 'utils'; import { Icon, If } from 'components'; /** * Avatar cell. */ function AvatarCell(row) { return {firstLettersArgs(row.email)}; } /** * Users table actions menu. */ export function ActionsMenu({ row: { original }, payload: { onEdit, onInactivate, onActivate, onDelete, onResendInvitation }, }) { const { formatMessage } = useIntl(); return ( } text={formatMessage({ id: 'edit_user' })} onClick={safeCallback(onEdit, original)} /> {original.active ? ( } /> ) : ( } /> )} } /> } text={formatMessage({ id: 'delete_user' })} onClick={safeCallback(onDelete, original)} intent={Intent.DANGER} /> ); } /** * Status accessor. */ function StatusAccessor(user) { return !user.is_invite_accepted ? ( ) : user.active ? ( ) : ( ); } /** * Actions cell. */ function ActionsCell(props) { return ( } position={Position.RIGHT_BOTTOM} >