Search

<%= if Enum.empty?(@results) do %> <% else %> <%= for result <- @results do %> <%= if result.type == "note" do %> <%= live_component @socket, MirageWeb.SearchLive.SearchResultComponent, result: result, url: Routes.note_show_path(@socket, :show, result.id) %> <% end %> <%= if result.type == "link" do %> <%= live_component @socket, MirageWeb.SearchLive.SearchResultComponent, result: result, url: Routes.link_show_path(@socket, :show, result.id) %> <% end %> <%= if result.type == "tag" do %> <%= live_component @socket, MirageWeb.SearchLive.SearchResultComponent, result: result, url: Routes.topic_path(@socket, :show, result.id) %> <% end %> <% end %> <% end %>