/** * External dependencies */ import { Slot, Fill } from '@wordpress/components'; /** * Internal dependencies */ import { createOrderedChildren, sortFillsByOrder } from '../../../utils'; export const EXPERIMENTAL_WC_MARKETING_OVERVIEW_SECTION_SLOT_NAME = 'experimental_woocommerce_marketing_overview_section'; /** * Create a Fill for extensions to add a section to the Marketing Overview page. * * @slotFill WooMarketingOverviewSection * @scope woocommerce-admin * @example * const MySection = () => ( * * * * Slotfill goes in here! * * * * ); * * registerPlugin( 'my-extension', { * render: MySection, * scope: 'woocommerce-admin', * } ); * @param {Object} param0 * @param {Array} param0.children - Node children. * @param {Array} param0.order - Node order. */ export const WooMarketingOverviewSection = ( { children, order = 1, }: { children: React.ReactNode; order?: number; } ) => { return ( { ( fillProps: Fill.Props ) => { return createOrderedChildren( children, order, fillProps ); } } ); }; WooMarketingOverviewSection.Slot = ( { fillProps, }: { fillProps?: Slot.Props; } ) => ( { sortFillsByOrder } );