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 { submitSignupStep } from 'calypso/state/signup/progress/actions'; import { getSiteBySlug } from 'calypso/state/sites/selectors'; import './style.scss'; class CloneStartStep extends Component { static propTypes = { flowName: PropTypes.string, goToNextStep: PropTypes.func.isRequired, positionInFlow: PropTypes.number, stepName: PropTypes.string, signupDependencies: PropTypes.object, }; goToNextStep = () => { const { originBlogId, originSiteSlug, originSiteName } = this.props; this.props.submitSignupStep( { stepName: this.props.stepName }, { originBlogId, originSiteSlug, originSiteName } ); this.props.goToNextStep(); }; renderStepContent() { const { originSiteSlug, translate } = this.props; return (

{ translate( "You're about to clone {{strong}}%(originSiteSlug)s{{/strong}}. " + 'All content, plugins, and themes will be copied to the ' + 'destination site.', { components: { strong: , }, args: { originSiteSlug, }, } ) }

{ translate( 'To clone your site, you will need the {{strong}}server credentials' + '{{/strong}} for the destination, which must be a WordPress site.', { components: { strong: , }, } ) }

); } render() { const { flowName, stepName, positionInFlow, originSiteName, translate } = this.props; const headerText = translate( "Let's clone %(origin)s", { args: { origin: originSiteName } } ); const subHeaderText = translate( "Create a test or staging site, migrate your site, or just back up your data for safekeeping — it's up to you!" ); return ( ); } } export default connect( ( state, ownProps ) => { const originSiteSlug = get( ownProps, 'stepSectionName', '' ); const site = getSiteBySlug( state, originSiteSlug ); const originSiteName = get( site, 'name', '' ); return { originBlogId: get( site, 'ID', -Infinity ), originSiteName, originSiteSlug, }; }, { submitSignupStep } )( localize( CloneStartStep ) );