/**
* 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 { InstalledPlugin } from '~/marketing/types';
import { useInstalledPluginsWithoutChannels } from '~/marketing/hooks';
export const InstalledExtensions = () => {
const { data, activatingPlugins, activateInstalledPlugin } =
useInstalledPluginsWithoutChannels();
if ( data.length === 0 ) {
return null;
}
const getButton = ( plugin: InstalledPlugin ) => {
if ( plugin.status === 'installed' ) {
return (
);
}
if ( plugin.status === 'activated' ) {
return (
);
}
if ( plugin.status === 'configured' ) {
return (
);
}
};
return (
{ data.map( ( el, idx ) => {
return (
}
name={ el.name }
description={ el.description }
button={ getButton( el ) }
/>
{ idx !== data.length - 1 && }
);
} ) }
);
};