import { Button } from '@automattic/components'; import { Icon, plugins } from '@wordpress/icons'; import { useTranslate } from 'i18n-calypso'; import FormInputCheckbox from 'calypso/components/forms/form-checkbox'; import { useLocalizedMoment } from 'calypso/components/localized-moment'; import { INSTALL_PLUGIN, UPDATE_PLUGIN } from 'calypso/lib/plugins/constants'; import PluginActivateToggle from 'calypso/my-sites/plugins/plugin-activate-toggle'; import PluginAutoupdateToggle from 'calypso/my-sites/plugins/plugin-autoupdate-toggle'; import PluginInstallButton from 'calypso/my-sites/plugins/plugin-install-button'; import UpdatePlugin from 'calypso/my-sites/plugins/plugin-management-v2/update-plugin'; import { useDispatch, useSelector } from 'calypso/state'; import { recordTracksEvent } from 'calypso/state/analytics/actions'; import { getBillingInterval } from 'calypso/state/marketplace/billing-interval/selectors'; import { isPluginActionInProgress, getPluginOnSite, } from 'calypso/state/plugins/installed/selectors'; import { isMarketplaceProduct } from 'calypso/state/products-list/selectors'; import PluginActionStatus from '../plugin-action-status'; import { getAllowedPluginActions } from '../utils/get-allowed-plugin-actions'; import { getPluginActionStatuses } from '../utils/get-plugin-action-statuses'; import type { PluginComponentProps } from '../types'; import type { SiteDetails } from '@automattic/data-stores'; import type { MomentInput } from 'moment'; import type { MouseEventHandler, PropsWithChildren } from 'react'; import './style.scss'; interface Props { item: PluginComponentProps; columnKey: string; selectedSite?: SiteDetails; isSmallScreen?: boolean; className?: string; updatePlugin?: ( plugin: PluginComponentProps ) => void; siteCount?: number; } export default function PluginRowFormatter( { item, columnKey, selectedSite, isSmallScreen, className, updatePlugin, }: Props ) { const translate = useTranslate(); const dispatch = useDispatch(); const billingPeriod = useSelector( getBillingInterval ); const pluginId = item.id || item.slug; // Plugin ID only available on Site plugin item object const PluginDetailsButton = ( props: PropsWithChildren< { className: string; onClick?: MouseEventHandler } > ) => { return (