using Gtk 4.0;

template $ExmCommentTile: Gtk.Widget {
  styles [
    "comment-tile"
  ]

  Gtk.Box {
    orientation: vertical;

    Gtk.Box {
      orientation: horizontal;

      Gtk.Label author {
        styles [
          "heading"
        ]

        xalign: 0;
        label: bind template.comment as <$ExmComment>.author;
      }

      Gtk.Label author_badge {
        styles [
          "author-badge"
        ]

        label: _("Author");
        visible: bind template.comment as <$ExmComment>.is_extension_creator;
      }

      $ExmRating rating {
        halign: end;
        hexpand: true;
        rating: bind template.comment as <$ExmComment>.rating;
        visible: bind template.comment as <$ExmComment>.rating as <bool>;
      }
    }

    Gtk.Label {
      styles [
        "multiline"
      ]

      label: bind template.comment as <$ExmComment>.comment;
      margin-top: 6;
      use-markup: true;
      wrap: true;
      wrap-mode: word_char;
      xalign: 0;
    }

    Gtk.Label date {
      styles [
        "dim-label"
      ]

      margin-top: 6;
      xalign: 0;
    }
  }
}
