<div class="stream-item">
  <div class="row">
    <div class="col s12">
        <span class="right">
          <%= render partial: 'content_page_shares/action_dropdown', locals: { share: share, content: content } %>
        </span>
      <%= link_to share.user, class: "#{User.text_color}" do %>
        <%= image_tag share.user.image_url(size=20), class: 'left circle avatar' %>
        <%= share.user.display_name %>
      <% end %>
      shared a
      <%= content.class.name.downcase %>:
      <%= link_to content.name, content, class: "#{content.class.text_color} text-darken-1" %>.
      <span class="right">
        <%= link_to [share.user, share], class: 'grey-text' do %>
          <%= time_ago_in_words share.created_at %> ago
        <% end %>
      </span>
    </div>
  </div>

  <div class="main-container hoverable card row clearfix">
    <div class="col s12 m6 l6">
      <div class="card-image">
        <%= link_to [share.user, share] do %>
          <%= image_tag content.first_public_image(format: :small) %>
        <% end %>
        <span class="card-title">
          <%= link_to content do %>
            <i class="material-icons tiny <%= content.class.text_color %>"><%= content.class.icon %></i>
            <span class="white-text bordered-text"><%= content.name %></i>
          <% end %>
        </span>
      </div>
    </div>

    <div class="col s12 m6 l6">
      <div class="card-content discussion-container">
        <% if share.message.present? %>
          <div class="metadata">
            <%= link_to share.user, class: "#{User.text_color}" do %>
              <%= image_tag share.user.image_url(size=20), class: 'left circle avatar' %>
              <%= share.user.display_name %>
            <% end %>
            <span class="helper-text">
              said 
              <%= link_to [share.user, share] do %><%= time_ago_in_words share.shared_at %> ago<% end %>:
            </span>
          </div>
          <blockquote class="original-comment black-text">
            <%=
              simple_format ContentFormatterService.show(
                text:         share.message,
                viewing_user: current_user
              )
            %>
          </blockquote>
        <% end %>

        Click here to read the document: <%= link_to content.title, content, class: "#{Document.text_color}" %>

        <% if user_signed_in? %>
          <%= render partial: 'share_comments/form', locals: { share: share } %>
        <% else %>
          <div class='center'>
            <%= link_to new_user_registration_path do %>
              To leave a comment, sign up for a free Notebook.ai account.
            <% end %>
          </div>
        <% end %>
        <br />
        
        <div class="uppercase grey-text center"><%= pluralize share.share_comments.count, 'comment' %></div>
        <div class="row">
          <% share.share_comments.each do |comment| %>
            <%= render partial: 'share_comments/show', locals: { comment: comment, share: share } %>
          <% end %>
        </div>

        <% if share.share_comments.count > 10 && user_signed_in? %>
          <%= render partial: 'share_comments/form', locals: { share: share } %>
        <% end %>
      </div>
    </div>
  </div>
</div>