File size: 848 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 |
import { localizeUrl } from '@automattic/i18n-utils';
import { JETPACK_CONTACT_SUPPORT } from '@automattic/urls';
import { addQueryArgs } from 'calypso/lib/url';
/**
* Creates a URL that refers to the Jetpack 'Contact Support' page,
* with accompanying useful information about the reason for the
* support request.
* @param {string?} [siteUrl] A site URL
* @param {string?} [scanState] The current state of Jetpack Scan/Backup
* @returns {string} The support request URL
*/
export default function contactSupportUrl( siteUrl, scanState ) {
// NOTE: This is an extremely simple, early implementation;
// if we add more options in the future, we'll want
// to come back and change how we build this query string
return addQueryArgs(
{
url: siteUrl,
'scan-state': scanState,
},
localizeUrl( JETPACK_CONTACT_SUPPORT )
);
}
|