Using widget logic I want to show only a widget on the archive page if there are no posts

The have_posts() function checks if the ‘main query’ returned any posts. is_tax can check if a certain taxonomy archive page is being shown.

In this case, the solution (taken from the comments):

if( is_tax( 'genre' ) && !have_posts() ){
 //Display widget
}