/**
 * Header 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.
 */

/**
 * External dependencies
 */
import { storiesOf } from '@storybook/react';

/**
 * WordPress dependencies
 */
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies
 */
import Header from '../assets/js/components/Header';
import DateRangeSelector from '../assets/js/components/DateRangeSelector';
import HelpMenu from '../assets/js/components/help/HelpMenu';
import { createTestRegistry, provideSiteInfo, provideUserAuthentication, WithTestRegistry } from '../tests/js/utils';
import HelpMenuLink from '../assets/js/components/help/HelpMenuLink';

const withRegistry = ( Story ) => {
	const registry = createTestRegistry();
	provideUserAuthentication( registry );
	provideSiteInfo( registry );

	return (
		<WithTestRegistry registry={ registry }>
			<Story registry={ registry } />
		</WithTestRegistry>
	);
};

storiesOf( 'Global', module )
	.add( 'Plugin Header', () => {
		return <Header />;
	}, {
		decorators: [
			withRegistry,
		],
	} )
	.add( 'Plugin Header with Date Selector', () => {
		return (
			<Header>
				<DateRangeSelector />
			</Header>
		);
	}, {
		decorators: [
			withRegistry,
		],
	} )
	.add( 'Plugin Header with Help Menu', () => {
		return (
			<Header>
				<HelpMenu />
			</Header>
		);
	}, {
		decorators: [
			withRegistry,
		],
	} )
	.add( 'Plugin Header with custom Help Menu links', () => {
		return (
			<Header>
				<HelpMenu>
					<HelpMenuLink href="#">
						{ __( 'Get help with AdSense', 'google-site-kit' ) }
					</HelpMenuLink>
				</HelpMenu>
			</Header>
		);
	}, {
		decorators: [
			withRegistry,
		],
	} );

@@ -1907,32 +1907,236 @@
 stry,%0A%09%09%5D,%0A%09%7D )%0A
+%09.add( 'Plugin Header with Help Menu and Date Range Selector', () =%3E %7B%0A%09%09return (%0A%09%09%09%3CHeader%3E%0A%09%09%09%09%3CHelpMenu /%3E%0A%09%09%09%09%3CDateRangeSelector /%3E%0A%09%09%09%3C/Header%3E%0A%09%09);%0A%09%7D, %7B%0A%09%09decorators: %5B%0A%09%09%09withRegistry,%0A%09%09%5D,%0A%09%7D )%0A
 %09.add( 'Plugin H

Add a new story with both help menu and date range selector.