using Gtk 4.0;
using Adw 1;

template $ExmCommentDialog: Adw.Dialog {
  content-width: 600;
  content-height: 600;
  width-request: 360;
  height-request: 294;
  title: _("Comments");

  child: Adw.ToolbarView {
    [top]
    Adw.HeaderBar {}

    content: Gtk.ScrolledWindow {
      Adw.Clamp {
        Gtk.Stack stack {
          vexpand: true;

          Gtk.StackPage {
            name: "page_spinner";

            child: Gtk.Box {
              orientation: vertical;
              spacing: 12;
              valign: center;

              Adw.Spinner {
                halign: center;
                valign: center;
                height-request: 32;
                width-request: 32;
              }

              Gtk.Label {
                styles [
                  "title-2"
                ]

                label: _("Loading Comments");
              }
            };
          }

          Gtk.StackPage {
            name: "page_error";

            child: Adw.StatusPage error_status {
              icon-name: "offline-symbolic";
              title: _("Connection Error");
            };
          }

          Gtk.StackPage {
            name: "page_comments";

            child: Gtk.ListBox list_box {
              styles [
                "content",
                "boxed-list"
              ]

              valign: start;
              selection-mode: none;
            };
          }
        }
      }
    };
  };
}
