@wordpress/widget-dashboard
Version:
Stateless rendering engine for widget dashboards: the WidgetDashboard compound component and its grid-settings kit.
17 lines (16 loc) • 541 B
JavaScript
// packages/widget-dashboard/src/utils/split-widget-actions.ts
function splitWidgetActions(widgetType) {
const actions = widgetType?.actions ?? [];
if (widgetType?.presentation === "full-bleed") {
return { footer: [], menu: actions };
}
const isPromoted = (action) => action.relevance === "high" || action.relevance === "medium";
return {
footer: actions.filter(isPromoted),
menu: actions.filter((action) => !isPromoted(action))
};
}
export {
splitWidgetActions
};
//# sourceMappingURL=split-widget-actions.mjs.map