My space on the web https://inhji.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

34 lines
1.1 KiB

<header class="hero">
<h1>Search</h1>
<form action="#">
<input id="query"
type="text"
placeholder="Search for anything..."
autocomplete="off"
phx-hook="SearchForm"
phx-keydown="search"
phx-debounce="200"
phx-update="ignore">
</form>
<div class="results">
<%= 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 %>
</div>
</header>