import { __ } from '@wordpress/i18n'; import { SelectControl } from '@wordpress/components'; import Toggle from '../../shared/Toggle'; type AutomationTogglerFieldsProps = { channelOptions: Array< { label: string; value: string } >; cookieConsentPluginActive: boolean; onInputChange: ( name: string, value: string | boolean ) => void; step: number; values: { pbr: string | false; formsend: string | false; login: string | false; woocommerce: string | false; consent?: string | false; }; }; export default function AutomationTogglerFields( props: AutomationTogglerFieldsProps ) { const { channelOptions, cookieConsentPluginActive, onInputChange, step, values } = props; const togglerSelectCn = step === 3 ? 'gs-select-control hidden' : 'gs-select-control'; const togglerSegmentCn = step === 0 ? 'gs-field-segment' : 'gs-field-segment gs-field-segment--nostyle'; const handleTogglerChange = ( key: string, event: React.ChangeEvent< HTMLInputElement > ) => { const { checked } = event.target; if ( checked ) { return onInputChange( key, 'default' ); } return onInputChange( key, false ); }; return ( <>
{ __( 'Choose events you want to track', 'liana-with-growthstack' ) }
{ __( 'Cookie consent', 'liana-with-growthstack' ) }
{ __( 'When a provider is selected, the tracking script is loaded only after the user consents to the Marketing cookie category.', 'liana-with-growthstack' ) }