/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin */ use crate::{RenderInfo, components::node_card::NodeCard, page}; use jellycommon::{Nku, routes::u_items_cont}; use jellyui_locale::tr; page!(Search<'_>, |x| tr(x.ri.lang, "search")); markup::define! { Search<'a>(ri: &'a RenderInfo<'a>, query: &'a str, items: &'a [Nku<'a>], cont: Option) { .search { h1 { @tr(ri.lang, "search") } form[action="", method="GET"] { input[type="text", name="q", placeholder=tr(ri.lang, "search.placeholder"), value=&query]; input[type="submit", value="Search"]; } } @if !items.is_empty() { ul.nl.grid { @for nku in *items { li { @NodeCard { ri, nku } } }} @if let Some(cont) = cont { a.next_page[href=u_items_cont(cont)] { button { "Show more" } } } } } }