/**
 * BannerNotifications component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 *
 */
import { useFeature } from '../../hooks/useFeature';
import useQueryArg from '../../hooks/useQueryArg';
import SetupSuccessBannerNotification from './SetupSuccessBannerNotification';
import CoreSiteBannerNotifications from './CoreSiteBannerNotifications';
import IdeaHubPromptBannerNotification from './IdeaHubPromptBannerNotification';
import UserInputPromptBannerNotification from './UserInputPromptBannerNotification';

export default function BannerNotifications() {
	const ideaHubModuleEnabled = useFeature( 'ideaHubModule' );
	const userInputEnabled = useFeature( 'userInput' );

	const [ notification ] = useQueryArg( 'notification' );

	if (
		'authentication_success' === notification ||
		'user_input_success' === notification
	) {
		return <SetupSuccessBannerNotification />;
	}

	if ( userInputEnabled ) {
		return <UserInputPromptBannerNotification />;
	}

	if ( ideaHubModuleEnabled ) {
		return <IdeaHubPromptBannerNotification />;
	}

	return <CoreSiteBannerNotifications />;
}

@@ -653,16 +653,120 @@
 %0A%0A/**%0A *
+ WordPress dependencies%0A */%0Aimport %7B Fragment %7D from '@wordpress/element';%0A%0A/**%0A * Internal dependencies
 %0A */%0Aimp
@@ -1554,20 +1554,42 @@
 %3E;%0A%09%7D%0A%0A%09
-if (
+return (%0A%09%09%3CFragment%3E%0A%09%09%09%7B
  userInp
@@ -1598,28 +1598,18 @@
 Enabled 
-) %7B%0A%09%09return
+&&
  %3CUserIn
@@ -1642,19 +1642,15 @@
 n /%3E
-;%0A%09%7D%0A%0A%09if (
+ %7D%0A%09%09%09%7B
  ide
@@ -1667,28 +1667,18 @@
 Enabled 
-) %7B%0A%09%09return
+&&
  %3CIdeaHu
@@ -1705,30 +1705,22 @@
 ation /%3E
-;%0A%09%7D%0A%0A%09return 
+ %7D%0A%09%09%09
 %3CCoreSit
@@ -1742,12 +1742,29 @@
 tions /%3E
+%0A%09%09%3C/Fragment%3E%0A%09)
 ;%0A%7D%0A

Fix BannerNotifications component behavior.