File size: 2,096 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { localizeUrl } from '@automattic/i18n-utils';
import { category, key, plugins, plus, receipt, store, tag } from '@wordpress/icons';
import { useTranslate } from 'i18n-calypso';
import { JETPACK_DASHBOARD_QUICK_LINKS_NAV_PREFERENCE } from 'calypso/state/jetpack-agency-dashboard/selectors';
import {
	JETPACK_MANAGE_BILLING_LINK,
	JETPACK_MANAGE_DASHBOARD_LINK,
	JETPACK_MANAGE_INVOICES_LINK,
	JETPACK_MANAGE_LICENCES_LINK,
	JETPACK_MANAGE_PLUGINS_LINK,
} from '../../../sidebar-navigation/lib/constants';
import FoldableNav from '../../foldable-nav';
import { FoldableNavItem } from '../../foldable-nav/types';

export default function QuickLinksNav() {
	const translate = useTranslate();

	const header = translate( 'Quick links' );
	const tracksName = 'calypso_jetpack_manage_overview_quick_links';

	const navItems: FoldableNavItem[] = [
		{
			icon: category,
			link: JETPACK_MANAGE_DASHBOARD_LINK,
			slug: 'manage_sites',
			title: translate( 'Manage all sites' ),
		},
		{
			icon: plus,
			link: localizeUrl( 'https://wordpress.com/jetpack/connect' ),
			slug: 'add_sites',
			title: translate( 'Add sites to Jetpack Manage' ),
		},
		{
			icon: plugins,
			link: JETPACK_MANAGE_PLUGINS_LINK,
			slug: 'manage_plugins',
			title: translate( 'Manage plugins' ),
		},
		{
			icon: key,
			link: JETPACK_MANAGE_LICENCES_LINK,
			slug: 'view_licenses',
			title: translate( 'View all licenses' ),
		},
		{
			icon: store,
			link: JETPACK_MANAGE_BILLING_LINK,
			slug: 'view_billing',
			title: translate( 'View billing' ),
		},
		{
			icon: receipt,
			link: JETPACK_MANAGE_INVOICES_LINK,
			slug: 'view_invoices',
			title: translate( 'View invoices' ),
		},
		{
			icon: tag,
			link: '/partner-portal/issue-license',
			slug: 'view_prices',
			title: translate( 'View prices' ),
		},
	].map( ( props ) => ( {
		...props,
		trackEventName: 'calypso_jetpack_manage_overview_quick_links_click',
	} ) );

	return (
		<FoldableNav
			header={ header }
			navItems={ navItems }
			preferenceName={ JETPACK_DASHBOARD_QUICK_LINKS_NAV_PREFERENCE }
			tracksName={ tracksName }
		/>
	);
}