/** * External dependencies */ import { __ } from '@wordpress/i18n'; import classNames from 'classnames'; import { Button } from '@wordpress/components'; import { getNewPath } from '@woocommerce/navigation'; /** * Internal dependencies */ import { Intro } from '.'; import { IntroSiteIframe } from './intro-site-iframe'; import { getAdminSetting } from '~/utils/admin-settings'; import { navigateOrParent } from '../utils'; export const BaseIntroBanner = ( { bannerTitle, bannerText, bannerClass, buttonIsLink, bannerButtonOnClick, bannerButtonText, secondaryButton, children, }: { bannerTitle: string; bannerText: string; bannerClass: string; buttonIsLink?: boolean; bannerButtonOnClick?: () => void; bannerButtonText?: string; secondaryButton?: React.ReactNode; children?: React.ReactNode; } ) => { return (

{ bannerTitle }

{ bannerText }

{ bannerButtonText && ( ) } { secondaryButton }
{ children }
); }; export const NetworkOfflineBanner = () => { return ( {} } /> ); }; export const JetpackOfflineBanner = ( { sendEvent, }: { sendEvent: React.ComponentProps< typeof Intro >[ 'sendEvent' ]; } ) => { return ( { sendEvent( { type: 'JETPACK_OFFLINE_HOWTO', } ); } } bannerButtonText={ __( 'Find out how', 'woocommerce' ) } /> ); }; export const ExistingThemeBanner = ( { setOpenDesignChangeWarningModal, }: { setOpenDesignChangeWarningModal: ( arg0: boolean ) => void; } ) => { return ( { setOpenDesignChangeWarningModal( true ); } } bannerButtonText={ __( 'Design with AI', 'woocommerce' ) } /> ); }; export const DefaultBanner = ( { sendEvent, }: { sendEvent: React.ComponentProps< typeof Intro >[ 'sendEvent' ]; } ) => { return ( { sendEvent( { type: 'DESIGN_WITH_AI', } ); } } bannerButtonText={ __( 'Design with AI', 'woocommerce' ) } /> ); }; export const ThemeHasModsBanner = ( { setOpenDesignChangeWarningModal, }: { setOpenDesignChangeWarningModal: ( arg0: boolean ) => void; } ) => { return ( { setOpenDesignChangeWarningModal( true ); } } bannerButtonText={ __( 'Design with AI', 'woocommerce' ) } /> ); }; export const ExistingAiThemeBanner = ( { setOpenDesignChangeWarningModal, }: { setOpenDesignChangeWarningModal: ( arg0: boolean ) => void; } ) => { const secondaryButton = ( ); const siteUrl = getAdminSetting( 'siteUrl' ) + '?cys-hide-admin-bar=1'; return ( { navigateOrParent( window, getNewPath( {}, '/customize-store/assembler-hub', {} ) ); } } bannerButtonText={ __( 'Customize', 'woocommerce' ) } secondaryButton={ secondaryButton } >
); };