איך להציג ווידג'ט בתפריט ההמבורגר?

The API was designed with the idea that everything in generalLinks would be a link widget:

https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/widgets/hamburger-menu.js#L189

So the example above is returning another Widget instance, when in fact you need to return one or more javascript object literals like in your working example. Those objects are the arguments to the link widget to make the links appear correctly.

It looks like the reason you want to do this is to open a modal. That’s achievable using an action. Try this:

const showModal = require("discourse/lib/show-modal").default;

api.reopenWidget('hamburger-menu', {
  openThing(e) {
     showModal('thing-modal');
  }
});

api.decorateWidget("hamburger-menu:generalLinks", function(helper) {
  return { action: 'openThing', label: 'open.thing' };
});

In this case I attach a new action called openThing to the hamburger menu, then trigger that via my link.