<%
  var title = ''
  var typeIcon = '';
  if (type === 'create_snapshot') {
    title = 'Creating New Snapshot';
    typeIcon = 'icon-time';
  }
  else if (type === 'remove_snapshot') {
    title = 'Removing Snapshot';
    typeIcon = 'icon-trash';
  }
  else if (type === 'restore_object') {
    title = 'Restoring Files';
    typeIcon = 'icon-download-alt';
  }
  else if (type === 'move_volume') {
    title = 'Moving Volume';
    typeIcon = 'icon-move';
  }

%>
<div class="item-box <%= state %>">
  <div class="item red-tooltip">
    <div class="title no-select"><%= formatTime(time) %></div>
    <i class="task-type-icon no-select <%= typeIcon %>"></i>
    <% if (state === 'failed') { %>
      <i class="task-failed-icon no-select icon-warning-sign"></i>
    <% } %>
    <i class="view-log icon-list-alt no-select"></i>
    <i class="toggle-info icon-chevron-down no-select"></i>
    <i class="icon icon-remove no-select"></i>
    <i class="icon icon-stop no-select"></i>
  </div>
  <div class="info">
    <span class="task-title"><%= title %></span><br>
    Volume: <%= volume_name %><br>
    Time: <%= formatTime(time) %><br>
    State: <%= state.charAt(0).toUpperCase() + state.slice(1) %><br>
    <% if (typeof snapshot_id !== 'undefined') { %>
      Snapshot ID: <%= snapshot_id %><br>
    <% } %>
    <span class="task-id">ID: <%= id %></span>
  </div>
</div>
