/** * External dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; import classnames from 'classnames'; import { Component } from '@wordpress/element'; import interpolateComponents from 'interpolate-components'; /** * WooCommerce dependencies */ import { WebPreview } from '@woocommerce/components'; /** * Internal dependencies */ import { recordEvent } from 'lib/tracks'; const devices = [ { key: 'mobile', icon: 'phone_android', }, { key: 'tablet', icon: 'tablet_android', }, { key: 'desktop', icon: 'desktop_windows', }, ]; class ThemePreview extends Component { constructor() { super( ...arguments ); this.state = { device: 'desktop', }; this.handleDeviceClick = this.handleDeviceClick.bind( this ); } handleDeviceClick( device ) { const { theme } = this.props; recordEvent( 'storeprofiler_store_theme_demo_device', { device, theme: theme.slug, } ); this.setState( { device } ); } render() { const { isBusy, onChoose, onClose, theme } = this.props; const { demo_url: demoUrl, slug, title } = theme; const { device: currentDevice } = this.state; return (