           max            : Math.max total, average
           current        : total
           color          : if total > average then 'green' else 'yellow'
-        text             : "List referrals here"
+        list             : {data}
+
+
+  viewAppended: ->
+
+    loader = @addTo this, loader: 'initial-loader'
+    @fetchData (err, {total, data})=>
+      loader.destroy()
+      unless showError err
+        @buildViews {total, data}
+
+
+  # TODO Move this to backend ~ GG
+  fetchData: (callback)->
+
+    {JReward} = remote.api
+    JReward.fetchEarnedAmount type: 'disk', (err, total) =>
+      return callback err  if err
+
+      JReward.some {type: 'disk'}, {limit: 30}, (err, rewards) =>
+        return callback err  if err
+
+        data = []
+
+        rewards.forEach (reward)->
+          data.push
+            friend       : reward.providedBy
+            status       : 'claimed'
+            lastActivity : timeago reward.createdAt
+            spaceEarned  : reward.amount
+
+        callback null, {total, data}


  ReferralCustomViews.mixin @prototype

  viewAppended: ->

    average = 6
    total   = 1

    @addCustomViews
      container_top      :

kd                  = require 'kd'
remote              = require('app/remote').getInstance()
timeago             = require 'timeago'
showError           = require 'app/util/showError'
ReferralCustomViews = require './referralcustomviews'


