/**
 * Subscribe with Google Account Create 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.
 */

/**
 * External dependencies
 */
import classnames from 'classnames';

/**
 * WordPress dependencies
 */
import { useCallback } from '@wordpress/element';

/**
 * Internal dependencies
 */
import Data from 'googlesitekit-data';
import { STORE_NAME } from '../../datastore/constants';
import { TextField, Input } from '../../../../material-components';
import { isValidRevenueModel } from '../../util/validation';
const { useDispatch, useSelect } = Data;

export default function RevenueModelInput() {
	// Get value.
	const revenueModel = useSelect( ( select ) =>
		select( STORE_NAME ).getRevenueModel()
	);

	// Handle form input.
	const { setRevenueModel } = useDispatch( STORE_NAME );
	const onChange = useCallback(
		( { currentTarget } ) => {
			setRevenueModel( currentTarget.value.trim() );
		},
		[ setRevenueModel ]
	);

	// Bail if the value isn't ready.
	if ( revenueModel === undefined ) {
		return null;
	}

	return (
		<TextField
			className={ classnames( {
				'mdc-text-field--error':
					revenueModel && ! isValidRevenueModel( revenueModel ),
			} ) }
			label="Revenue Model"
			outlined
		>
			<Input
				id="revenueModel"
				name="revenueModel"
				value={ revenueModel }
				onChange={ onChange }
			/>
		</TextField>
	);
}

@@ -961,23 +961,21 @@
 t %7B 
-TextField, Inpu
+Option, Selec
 t %7D 
@@ -1117,16 +1117,161 @@
  Data;%0A%0A
+const REVENUE_MODELS = %5B%0A%09%7B displayName: 'Contributions', value: 'contribution' %7D,%0A%09%7B displayName: 'Subscriptions', value: 'subscription' %7D,%0A%5D;%0A%0A
 export d
@@ -1534,25 +1534,13 @@
 %09%09( 
-%7B currentTarget %7D
+index
  ) =
@@ -1567,34 +1567,37 @@
 el( 
-currentTarget.value.trim()
+REVENUE_MODELS%5B index %5D.value
  );%0A
@@ -1732,25 +1732,22 @@
 rn (%0A%09%09%3C
-TextField
+Select
 %0A%09%09%09clas
@@ -1898,39 +1898,16 @@
 %0A%09%09%09
-outlined%0A%09%09%3E%0A%09%09%09%3CInput%0A%09%09%09%09id=%22
+value=%7B 
 reve
@@ -1918,106 +1918,226 @@
 odel
-%22
+ %7D
 %0A%09%09%09
-%09name=%22revenueModel%22%0A%09%09%09%09value=%7B revenueModel
+onEnhancedChange=%7B onChange %7D%0A%09%09%09enhanced%0A%09%09%09outlined%0A%09%09%3E%0A%09%09%09%7B REVENUE_MODELS.map( ( %7B displayName, value %7D ) =%3E (%0A%09%09%09%09%3COption key=%7B value %7D value=%7B value
  %7D
+%3E
 %0A%09%09%09%09
-onChange=%7B onChange %7D%0A%09%09%09/%3E%0A%09%09%3C/TextField
+%09%7B displayName %7D%0A%09%09%09%09%3C/Option%3E%0A%09%09%09) ) %7D%0A%09%09%3C/Select
 %3E%0A%09)

Use a Select.