using Gtk 4.0;
using Adw 1;

template $ResultsPage : Adw.NavigationPage {
    title: _("Search a Remote");
    Adw.ToolbarView {
        [top]
        Adw.HeaderBar {}
        [top]
        Adw.Clamp {
            maximum-size: 577;
            margin-top:    3;
            margin-bottom: 3;
            margin-start: 6;
            margin-end:   6;
            SearchEntry search_entry {
                search-delay: 500;
                halign: fill;
                // hexpand: true;
                placeholder-text: _("Search for Packages");
            }
        }
        Stack stack {
            Adw.StatusPage new_search {
                icon-name: "loupe-large-symbolic";
                title: _("Search for Flatpaks");
                description: _("Search for Flatpaks you want to install");
            }
            Adw.StatusPage too_many {
                icon-name: "error-symbolic";
                title: _("Too Many Results");
                description: _("Try being more specific with your search");
            }
            ScrolledWindow results_view {
                Adw.Clamp {
                    ListBox results_list {
                        margin-start:  12;
                        margin-end:    12;
                        margin-top:    12;
                        margin-bottom: 12;
                        styles ["boxed-list"]
                        selection-mode: none;
                        valign: start;
                    }
                }
            }
            Adw.StatusPage no_results {
                icon-name: "loupe-large-symbolic";
                title: _("No Results Found");
                description: _("Try a different search term");
            }
        }
    }
}
