File size: 957 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import {
	PLUGIN_INSTALLATION_IN_PROGRESS as IN_PROGRESS,
	PLUGIN_INSTALLATION_ERROR as ERROR,
} from 'calypso/state/plugins/installed/status/constants';
import { PluginActionMessagesByStatus } from './types';

const RemoveMessages: PluginActionMessagesByStatus = {
	[ IN_PROGRESS ]: ( { hasSelectedSite, siteCount } ) =>
		hasSelectedSite
			? ( translate ) => translate( 'Removing Plugin' )
			: ( translate ) =>
					translate(
						'Removing plugin from %(count)s site',
						'Removing plugin from %(count)s sites',
						{ args: { count: siteCount }, count: siteCount }
					),
	[ ERROR ]: ( { hasSelectedSite, siteCount } ) =>
		hasSelectedSite
			? ( translate ) => translate( 'Failed to remove plugin' )
			: ( translate ) =>
					translate(
						'Failed to remove plugin from %(count)s site',
						'Failed to remove plugin from %(count)s sites',
						{ args: { count: siteCount }, count: siteCount }
					),
};

export default RemoveMessages;