/**
 * Admin Bar Widgets Component Stories.
 *
 * 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.
 */

/**
 * Internal dependencies
 */
import {
	provideModules,
	provideModuleRegistrations,
	provideUserAuthentication,
} from '../../../../tests/js/utils';
import {
	setupSearchConsoleAnalyticsMockReports,
	setupSearchConsoleMockReports,
	setupSearchConsoleAnalyticsGatheringData,
	setupSearchConsoleAnalyticsZeroData,
	widgetDecorators,
} from './common.stories';
import WithRegistrySetup from '../../../../tests/js/WithRegistrySetup';
import AdminBarWidgets from './AdminBarWidgets';

const Template = ( { setupRegistry = () => {}, ...args } ) => (
	<WithRegistrySetup func={ setupRegistry }>
		<AdminBarWidgets { ...args } />
	</WithRegistrySetup>
);

export const Ready = Template.bind( {} );
Ready.storyName = 'Ready';
Ready.args = {
	setupRegistry: setupSearchConsoleAnalyticsMockReports,
};

export const AnalyticsInactive = Template.bind( {} );
AnalyticsInactive.storyName = 'Inactive: Analytics';
AnalyticsInactive.args = {
	setupRegistry: ( registry ) => {
		// Set up the search console module store but provide no data.
		provideModules( registry, [
			{
				slug: 'search-console',
				active: true,
				connected: true,
			},
		] );
		setupSearchConsoleMockReports( registry );
	},
};

export const AnalyticsInactiveNew = Template.bind( {} );
AnalyticsInactiveNew.storyName = 'Inactive: Analytics New CTA';
AnalyticsInactiveNew.args = {
	setupRegistry: ( registry ) => {
		provideModules( registry );
		setupSearchConsoleMockReports( registry );
	},
};

export const AnalyticsInactiveNewCompleteActivation = Template.bind( {} );
AnalyticsInactiveNewCompleteActivation.storyName =
	'Inactive: Analytics New Complete Activation CTA';
AnalyticsInactiveNewCompleteActivation.args = {
	setupRegistry: ( registry ) => {
		// Set up the analytics module store but provide no data.
		provideModules( registry, [
			{
				slug: 'analytics',
				active: true,
				connected: false,
			},
		] );
		provideModuleRegistrations( registry );
		provideUserAuthentication( registry );
		setupSearchConsoleMockReports( registry );
	},
};

export const GatheringData = Template.bind( {} );
GatheringData.storyName = 'Gathering Data';
GatheringData.args = {
	setupRegistry: setupSearchConsoleAnalyticsGatheringData,
};

export const ZeroData = Template.bind( {} );
ZeroData.storyName = 'Zero Data';
ZeroData.args = {
	setupRegistry: setupSearchConsoleAnalyticsZeroData,
};

export default {
	title: 'Views/AdminBarApp/AdminBarWidgets',
	decorators: widgetDecorators,
};

@@ -1553,19 +1553,29 @@
 nalytics
+ Setup CTA
 ';%0A
-
 Analytic
@@ -1864,276 +1864,8 @@
 %7D;%0A%0A
-export const AnalyticsInactiveNew = Template.bind( %7B%7D );%0AAnalyticsInactiveNew.storyName = 'Inactive: Analytics New CTA';%0AAnalyticsInactiveNew.args = %7B%0A%09setupRegistry: ( registry ) =%3E %7B%0A%09%09provideModules( registry );%0A%09%09setupSearchConsoleMockReports( registry );%0A%09%7D,%0A%7D;%0A%0A
 expo
@@ -1986,16 +1986,16 @@
 yName =%0A
+
 %09'Inacti
@@ -2012,12 +2012,8 @@
 ics 
-New 
 Comp

Remove stale story from pre-zeroDataStates days.