import { createElement, Component, useState } from '@wordpress/element' import { __, sprintf } from 'ct-i18n' const SinglePremiumPlugin = ({ status, plugin, onPluginsSync }) => { const [isLoading, setIsLoading] = useState(false) const makeAction = async (plugin, actionName) => { const body = new FormData() body.append('plugin', plugin) body.append('action', actionName) setIsLoading(true) try { await fetch(ctDashboardLocalizations.ajax_url, { method: 'POST', body }) onPluginsSync() } catch (e) {} await new Promise(r => setTimeout(() => r(), 1000)) setIsLoading(false) } return (
{plugin.description}
}