File size: 928 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
30
31
32
33
34
import { Dialog, Gridicon } from '@automattic/components';
import { useTranslate } from 'i18n-calypso';

export default function ItemRemoveDialog( props ) {
	const { title, visibility, onClose, type } = props;
	const translate = useTranslate();

	return (
		<Dialog
			isVisible={ visibility }
			buttons={ [
				{ action: 'cancel', label: translate( 'Cancel' ) },
				{ action: 'delete', label: translate( 'Remove' ), isPrimary: true },
			] }
			onClose={ ( action ) => {
				onClose( action === 'delete' );
			} }
		>
			<h1>{ translate( 'Are you sure you want to remove this item?' ) }</h1>
			{ title && (
				<p className="list-manage__dialog-item-title">
					<Gridicon
						className="list-manage__dialog-item-title-icon"
						icon={ type === 'tag' ? 'tag' : 'globe' }
						size="16"
					/>
					<strong>{ title }</strong>
				</p>
			) }
			<p>{ translate( 'This action cannot be undone.' ) }</p>
		</Dialog>
	);
}