/** * Free Rollback Complete Modal. * Uses RollbackContext for state management. * * @param {Object} props Component properties * @param {Object} props.buttons Button configuration for the template * @return {JSX.Element} Complete template content */ import { ExternalLink, Icon, Button, Notice } from '@wordpress/components'; import { __, sprintf } from '@wordpress/i18n'; import { useRollbackContext } from '@wp-rollback/shared-core/context/RollbackContext'; import { useNavigate } from 'react-router-dom'; import { useEffect } from '@wordpress/element'; import { check, starFilled, shield, backup, list, help } from '@wordpress/icons'; import RollbackButtons from '@wp-rollback/shared-core/components/modals/RollbackButtons'; const FreeCompleteTemplate = ( { buttons } ) => { const { rollbackInfo, rollbackVersion, setCurrentVersion } = useRollbackContext(); const navigate = useNavigate(); // Update the current version to the rolled-back version. useEffect( () => { if ( rollbackVersion ) { setCurrentVersion( rollbackVersion ); } }, [ rollbackVersion, setCurrentVersion ] ); // Don't render until we have the required data if ( ! rollbackInfo || ! rollbackVersion ) { return null; } const successMessage = sprintf( /* translators: 1: Asset name 2: Asset version */ __( '%1$s has been successfully rolled back to version %2$s.', 'wp-rollback' ), `${ rollbackInfo.name }`, `${ rollbackVersion }` ); const proFeatures = [ { icon: list, title: __( 'Detailed Activity Logs', 'wp-rollback' ), description: __( 'Track every rollback with comprehensive logs and notes', 'wp-rollback' ), }, { icon: backup, title: __( 'Version Preservation', 'wp-rollback' ), description: __( 'Preserve current versions of premium assets before updates', 'wp-rollback' ), }, { icon: shield, title: __( 'Priority Support', 'wp-rollback' ), description: __( 'Get expert help when you need it most', 'wp-rollback' ), }, ]; return ( <> {/* Success Message */}
{/* What's Next Section */}

{ __( "What's next?", 'wp-rollback' ) }

  1. { __( 'Check your website to verify the rollback resolved any visual or functional issues', 'wp-rollback' ) }
  2. { __( "If you rolled back due to an error message, review your error logs to confirm it's resolved", 'wp-rollback' ) }
  3. { __( 'Test key functionality on your site to ensure everything works as expected', 'wp-rollback' ) }
{/* Pro Features Upgrade Card */}

{ __( 'Upgrade to WP Rollback Pro', 'wp-rollback' ) }

{ __( 'Take your rollback management to the next level with professional features designed for serious WordPress sites.', 'wp-rollback' ) }

{ proFeatures.map( ( feature, index ) => (
{ feature.title }

{ feature.description }

) ) }
{ __( 'Learn more', 'wp-rollback' ) }
{/* Help Section */}

{ __( 'Need help with your rollback?', 'wp-rollback' ) }

{ __( 'View our troubleshooting guide', 'wp-rollback' ) }
); }; export default FreeCompleteTemplate;