@wordpress/block-library
Version:
Block library for the WordPress editor.
30 lines (28 loc) • 870 B
JavaScript
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import { ChainIcon } from './icons';
/**
* Retrieves the social service's icon component and label.
*
* @param {Object} variation The object of the social service variation.
* @return {Object} An object containing the Icon component for social service and label.
*/
export function getSocialService(variation) {
var _variation$icon, _variation$title;
if (!variation?.name) {
return {
icon: ChainIcon,
label: __('Social Icon')
};
}
return {
icon: (_variation$icon = variation?.icon) !== null && _variation$icon !== void 0 ? _variation$icon : ChainIcon,
label: (_variation$title = variation?.title) !== null && _variation$title !== void 0 ? _variation$title : __('Social Icon')
};
}
//# sourceMappingURL=social-list.js.map