woocommerce-paypal-payments/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Navigation.js
2025-01-28 10:22:42 +01:00

23 lines
677 B
JavaScript

import { Button } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import TopNavigation from '../../../ReusableComponents/TopNavigation';
import { useSaveSettings } from '../../../../hooks/useSaveSettings';
const SettingsNavigation = ( { canSave = true } ) => {
const { persistAll } = useSaveSettings();
const title = __( 'PayPal Payments', 'woocommerce-paypal-payments' );
return (
<TopNavigation title={ title } exitOnTitleClick={ true }>
{ canSave && (
<Button variant="primary" onClick={ persistAll }>
{ __( 'Save', 'woocommerce-paypal-payments' ) }
</Button>
) }
</TopNavigation>
);
};
export default SettingsNavigation;