@automattic/calypso-products
Version:
This module contains information about the various products sold within calypso, such as product slugs, plan intervals, etc.
15 lines (13 loc) • 543 B
text/typescript
import { getJetpackProductsShortDescriptions } from './translations';
import type { Product } from './types';
import type { TranslateResult } from 'i18n-calypso';
/**
* Get Jetpack product short description based on the product purchase object.
*/
export function getJetpackProductShortDescription( product: Product ): TranslateResult | undefined {
const jetpackProductsShortDescriptions = getJetpackProductsShortDescriptions() as Record<
string,
TranslateResult
>;
return jetpackProductsShortDescriptions[ product.product_slug ];
}