File size: 727 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 |
import type { SiteExcerptData } from '@automattic/sites';
export const useSites = (): SiteExcerptData[] => {
const {
siteId,
isAtomic,
isStaging,
isPrivate,
isComingSoon,
isP2,
siteHostname,
siteName,
shouldUseWpAdmin,
isWpcomStore,
} = window.commandPaletteConfig;
// Only the current site is available on WP Admin.
return [
{
ID: siteId,
slug: siteHostname,
name: siteName,
jetpack: isAtomic,
is_wpcom_atomic: isAtomic,
is_coming_soon: isComingSoon,
options: {
is_wpforteams_site: isP2,
wpcom_admin_interface: shouldUseWpAdmin ? 'wp-admin' : 'calypso',
is_wpcom_store: isWpcomStore,
},
is_private: isPrivate,
is_wpcom_staging_site: isStaging,
},
];
};
|