/**
* External dependencies
*/
import { Fragment } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import { recordEvent } from '@woocommerce/tracks';
/**
* Internal dependencies
*/
import {
CollapsibleCard,
CardDivider,
ProductIcon,
PluginCardBody,
} from '~/marketing/components';
import { Plugin } from './types';
import { usePlugins } from './usePlugins';
export const InstalledExtensions = () => {
const { installedPlugins, activatingPlugins, activateInstalledPlugin } =
usePlugins();
if ( installedPlugins.length === 0 ) {
return null;
}
const getButton = ( plugin: Plugin ) => {
if ( plugin.status === 'installed' ) {
return (
);
}
if ( plugin.status === 'activated' ) {
return (
);
}
if ( plugin.status === 'configured' ) {
return (
);
}
};
return (
{ installedPlugins.map( ( el, idx ) => {
return (
}
name={ el.name }
description={ el.description }
button={ getButton( el ) }
/>
{ idx !== installedPlugins.length - 1 && (
) }
);
} ) }
);
};