mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-05-03 06:19:01 +08:00
# Conflicts: # composer.json # composer.lock # modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/Blocks/PaypalSettings.js # modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/CommonSettings.js # modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Settings/ConnectionStatus.js # modules/ppcp-settings/resources/js/hooks/useStoreManager.js # modules/ppcp-settings/webpack.config.js # package.json # tests/PHPUnit/bootstrap.php # tests/stubs/WC_Integration.php
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import { __ } from '@wordpress/i18n';
|
|
import {
|
|
registerSetting,
|
|
createExtensionStore,
|
|
SLOTS,
|
|
} from '@ppcp-settings/extensions';
|
|
import SettingsBlock from '@ppcp-settings/Components/ReusableComponents/SettingsBlock';
|
|
import { ControlToggleButton } from '@ppcp-settings/Components/ReusableComponents/Controls/index.js';
|
|
|
|
const useSettings = createExtensionStore( {
|
|
name: 'agentic-settings',
|
|
defaults: {
|
|
active: false,
|
|
},
|
|
} );
|
|
|
|
const AgenticSettings = () => {
|
|
const { active, setActive } = useSettings();
|
|
|
|
return (
|
|
<SettingsBlock
|
|
title={ __( 'Agentic Commerce', 'woocommerce-paypal-payments' ) }
|
|
>
|
|
<ControlToggleButton
|
|
label={ __(
|
|
'Agentic Features',
|
|
'woocommerce-paypal-payments'
|
|
) }
|
|
description={ __(
|
|
'Allow the PayPal AI agent to shop on this store - payments are collected by this plugin, while the customer never visits your website.',
|
|
'woocommerce-paypal-payments'
|
|
) }
|
|
value={ active }
|
|
onChange={ setActive }
|
|
/>
|
|
</SettingsBlock>
|
|
);
|
|
};
|
|
|
|
registerSetting(
|
|
SLOTS.PAYPAL_SETTINGS_END,
|
|
'agentic-settings',
|
|
AgenticSettings,
|
|
10
|
|
);
|