<h4>Your document is being analyzed...</h4>
<div class="progress">
  <div class="determinate" style="width: <%= analysis.progress %>%"></div>
</div>
<p>
  Notebook.ai is processing this document right now. 
  Refresh this page to see progress or check back later. You'll get a notification when it's ready!
</p>

<h4>Progress</h4>
<div class="row">
  <div class="col s12 m6">
    <div class="card">
      <div class="card-content">
        <div class="card-title">Word Choice</div>
        <div class="progress">
          <% if analysis && analysis.progress >= 25 %>
            <div class="determinate <%= Document.color %>" style="width: 100%"></div>
          <% else %>
            <div class="indeterminate yellow"></div>
          <% end %>
        </div>
        <% if analysis && analysis.progress < 25 %>
          <p class="help-text">
            Analyzing...
          </p>
        <% else %>
          <p class="help-text">
            Analysis complete.
          </p>
        <% end %>
      </div>
    </div>
  </div>

  <div class="col s12 m6">
    <div class="card">
      <div class="card-content">
        <div class="card-title">Readability</div>
        <div class="progress">
          <% if analysis && analysis.progress >= 50 %>
            <div class="determinate <%= Document.color %>" style="width: 100%"></div>
          <% else %>
            <div class="indeterminate yellow"></div>
          <% end %>
        </div>
        <% if analysis && analysis.progress < 50 %>
          <p class="help-text">
            Analyzing...
          </p>
        <% else %>
          <p class="help-text">
            Analysis complete.
          </p>
        <% end %>
      </div>
    </div>
  </div>

  <div class="col s12 m6">
    <div class="card">
      <div class="card-content">
        <div class="card-title">Entities</div>
        <div class="progress">
          <% if analysis && analysis.progress >= 75 %>
            <div class="determinate <%= Document.color %>" style="width: 100%"></div>
          <% else %>
            <div class="indeterminate orange"></div>
          <% end %>
        </div>
        <% if analysis && analysis.progress < 75 %>
          <p class="help-text">
            Analyzing...
          </p>
        <% else %>
          <p class="help-text">
            Analysis complete.
          </p>
        <% end %>
      </div>
    </div>
  </div>

  <div class="col s12 m6">
    <div class="card">
      <div class="card-content">
        <div class="card-title">Emotion</div>
          <div class="progress">
            <div class="indeterminate orange"></div>
          </div>
          <p class="help-text">
            Analyzing...
          </p>
        </div>
    </div>
  </div>
</div>

<div class="center">
  <%= link_to 'Refresh page', analysis_document_path(analysis.document), class: "btn #{Document.color} white-text" %>
</div>
<p class="center grey-text">
  <% if analysis.progress > 0 %>
    Your analysis is currently processing.
  <% else %>
    Your analysis was queued <%= time_ago_in_words analysis.created_at %> ago.
  <% end %>
</p>
