<div id="<%= dom_id(recipe, :favorite) %>">
  <% if signed_in? %>
    <% if favorite = current_user.favorites.find_by(recipe: recipe) %>
      <%= render "recipes/destroy_favorite_button", recipe: recipe, favorite: favorite %>
    <% else %>
      <%= render "recipes/new_favorite_button", recipe: recipe %>
    <% end %>
  <% end %>
</div>
