<tr>
  <td data-behavior="select_broadcast"><%= check_box_tag "broadcast_ids[]", broadcast.id, false %></td>
  <td>
    <%= broadcast.name %>
  </td>
  <td>
    <%= broadcast.status.titleize %>
  </td>
  <td>
    <%= time_ago_in_words(broadcast.created_at) %> ago
  </td>
  <td class="text-right">
    <div class="btn-group">
      <%= button_tag t(".actions.manage"), class: "btn btn-light btn-sm dropdown-toggle border", data: { toggle: "dropdown", boundary: "window" }, aria: { haspopup: true, expanded: false } %>
      <div class="dropdown-menu dropdown-menu-right">
        <%= link_to fa_icon("link fw", text: "Copy Stream URL"), ENV['MUX_BROADCAST_SERVER_URL'], class: "dropdown-item", data: { behavior: "clipboard" } %>
        <%= link_to fa_icon("key fw", text: "Copy Stream Key"), broadcast.stream_key, class: "dropdown-item", data: { behavior: "clipboard" } %>
        <% if policy(broadcast).show? %>
          <%= link_to fa_icon("file-video-o fw", text: "View"), [broadcast.project, broadcast], class: "dropdown-item", target: '_blank' %>
        <% end %>
        <% if policy(broadcast).destroy? %>
          <%= link_to fa_icon("trash fw", text: "Delete"), [broadcast.project, broadcast], class: "dropdown-item", method: :delete, data: { confirm: "Are you sure?" } %>
        <% end %>
      </div>
    </div>
  </td>
</tr>
