you can either have the function/interface on the unitbase, for playerunit override function to add widget, for AI unit do nothing.
or put a bool on the unit, bIsPlayer and use that if you want to handle the widget elsewhere.
both are fine it just depends on the structure of your game