import { Card, Button } from '@automattic/components'; import { localize } from 'i18n-calypso'; import { get } from 'lodash'; import PropTypes from 'prop-types'; import { Component } from 'react'; import { connect } from 'react-redux'; import StepWrapper from 'calypso/signup/step-wrapper'; import { rewindClone } from 'calypso/state/activity-log/actions'; import { recordTracksEvent, withAnalytics } from 'calypso/state/analytics/actions'; import { submitSignupStep } from 'calypso/state/signup/progress/actions'; import './style.scss'; class CloneReadyStep extends Component { static propTypes = { flowName: PropTypes.string, goToNextStep: PropTypes.func.isRequired, positionInFlow: PropTypes.number, stepName: PropTypes.string, signupDependencies: PropTypes.object, }; goToNextStep = () => { const { originBlogId, clonePoint } = this.props.payload; this.props.submitSignupStep( { stepName: this.props.stepName } ); this.props.initRewind( originBlogId, clonePoint, this.props.payload ); this.props.goToNextStep(); }; renderStepContent() { const { destinationSiteName, translate } = this.props; return (

{ translate( 'Any content on %(destinationSiteName)s, where you want to clone your content, ' + 'will be overridden. Is this okay?', { args: { destinationSiteName } } ) }

); } render() { const { flowName, stepName, positionInFlow, translate } = this.props; const headerText = translate( 'Ready to clone!' ); return ( ); } } export default connect( ( state, ownProps ) => ( { destinationSiteName: get( ownProps, [ 'signupDependencies', 'destinationSiteName' ] ), payload: get( ownProps, [ 'signupDependencies' ], {} ), } ), { submitSignupStep, initRewind: ( blogId, timestamp, payload ) => withAnalytics( recordTracksEvent( 'calypso_activitylog_clone_request' ), rewindClone( blogId, timestamp, payload ) ), } )( localize( CloneReadyStep ) );