{ pluginsToPromote.map(
( pluginToPromote ) => {
const pluginsForPartner = [
pluginToPromote?.slug,
pluginToPromote?.dependencies,
].filter(
( element ) =>
element !== undefined
); // remove undefineds
return pluginToPromote[
'dual-partner-layout'
]( {
children: (
{
createNoticesFromResponse(
response
);
recordEvent(
'tasklist_shipping_label_printing',
{
install: true,
plugins_to_activate:
pluginsForPartner,
}
);
invalidateResolutionForStoreSelector();
this.completeStep();
} }
onError={ (
errors,
response
) =>
createNoticesFromResponse(
response
)
}
installText={ __(
'Install and enable',
'woocommerce'
) }
learnMoreLink={
pluginToPromote.url
}
onLearnMore={ () => {
recordEvent(
'tasklist_shipping_label_printing_learn_more',
{
plugin: pluginToPromote.slug,
}
);
} }
pluginSlugs={
pluginsForPartner
}
installButtonVariant={
'secondary'
}
/>
),
} );
}
) }
) }
{ pluginsToPromote.length === 1 &&
pluginsToPromote[ 0 ].slug === undefined && ( // if it doesn't have a slug we just show a download button