defmodule MusicLibraryWeb.SearchComponents do @moduledoc """ Universal search modal and related components. """ use MusicLibraryWeb, :html alias MusicLibrary.Records.Record @doc """ Renders a search trigger button that opens the universal search modal. ## Examples <.search_trigger /> """ attr :class, :string, default: "" attr :rest, :global, include: ~w(phx-click phx-target) def search_trigger(assigns) do ~H""" """ end @doc """ Renders a search result item for records. ## Examples <.search_result_record record={record} selected={false} /> """ attr :record, :map, required: true attr :selected, :boolean, default: false attr :type, :atom, required: true, values: [:collection, :wishlist] attr :rest, :global, include: ~w(phx-click phx-value-id) def search_result_record(assigns) do ~H"""
{@record.title}
{Record.artist_names(@record)}
{@artist.name}
{@artist.disambiguation}
Start typing to search your records and artists
Use Ctrl+K to open this search
No results found for "{@query}"
Try a different search term or check your spelling
Searching...