 GroupButtons.displayName = 'GroupButtons'
 
 export GroupSorts = React.memo ({group, can, sortBy, clusterBy, tags}) ->
+  superuser = useTracker ->
+    Session.get 'super'
+  , []
+  onSortSetDefault = (e) ->
+    e.stopPropagation()
+    unparsed = unparseSort sortBy
+    console.log "Setting default sort for #{group} to #{unparsed}"
+    Meteor.call 'groupDefaultSort', group, unparsed
   dropSpec = (key) ->
     accept: 'group-sort'
     drop: (item, monitor) ->

        console.error "messageNew did not return problem -- not authorized?"

  <> {###<div className="group-right-buttons">###}
    {if superuser
      <div className="btn-group">
        <button className="btn btn-warning sortSetDefault" onClick={onSortSetDefault}>
          Set Group Default Sort
        </button>
        {if can.globalSuper
          <button className="btn btn-danger groupRenameButton" onClick={onRename}>
            Rename Group
          </button>
        }
      </div>
    }


Group.displayName = 'Group'

export GroupButtons = React.memo ({group, can, sortBy, clusterBy, tags}) ->
  #superuser = useTracker ->
  #  Session.get 'super'
  #, []
  user = useTracker ->
    Meteor.user()
  , []
