/** * External dependencies */ import { __, sprintf } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; import { getAdminLink } from '@woocommerce/wc-admin-settings'; import { recordEvent } from '@woocommerce/tracks'; import { Text } from '@woocommerce/experimental'; import { Pill } from '@woocommerce/components'; /** * Internal dependencies */ import './Plugin.scss'; export type PluginProps = { isActive: boolean; isBusy?: boolean; isBuiltByWC: boolean; isDisabled?: boolean; isInstalled: boolean; description?: string; installAndActivate?: ( slug: string ) => void; imageUrl?: string; manageUrl?: string; name: string; slug: string; }; export const Plugin: React.FC< PluginProps > = ( { description, imageUrl, installAndActivate = () => {}, isActive, isBusy, isBuiltByWC, isDisabled, isInstalled, manageUrl, name, slug, } ) => { return (
{ imageUrl && (
{
) }
{ name } { isBuiltByWC && ( { __( 'Built by WooCommerce', 'woocommerce-admin' ) } ) } { description }
{ isActive && manageUrl && ( ) } { isInstalled && ! isActive && ( ) } { ! isInstalled && ( ) }
); };