They are not giving up with the console market. Sure, they don't sell as much as they would like, but NX is going to be a consle, a handheld and why not, a tablet.
But they'll use the nx handheld as a gamepad for the console. That's what I think they are going to do.
The wii u's gamepad is horrible. When I play a lot my hands hurt, not joking. The thing is bulky, heavy and uncomfortable. And it was a very bad decision. They couldn't sell it to the market because they had no games that justified it and I have read a lot of complaints from gamers that hated the gamepad, even hardcore nintendo fans.
The best thing they could do is release a console powerful enough (maybe close to the ps4) with a wii u pro controller. And then give the option to use the nx handeld like the wii u gamepad to everyone who loved it.
That way people would have more options and the console wouldn't have a gimmick like the gamepad was.
It's a win/win situation! :P