/** * External dependencies */ import { Slot, Fill } from '@wordpress/components'; import { createOrderedChildren, sortFillsByOrder, } from '@woocommerce/components'; export const EXPERIMENTAL_WC_TASKLIST_FOOTER_SLOT_NAME = 'experimental_woocommerce_tasklist_footer_item'; /** * Create a Fill for extensions to add items to the WooCommerce Admin Task List footer. * * @slotFill ExperimentalWooTaskListFooterItem * @scope woocommerce-admin * @example * const MyFooterItem = () => ( * * * * Slotfill goes in here! * * * ); * * registerPlugin( 'my-extension', { * render: MyFooterItem, * scope: 'woocommerce-admin', * } ); * @param {Object} param0 * @param {Array} param0.children - Node children. * @param {Array} param0.order - Node order. */ export const ExperimentalWooTaskListFooterItem = ( { children, order = 1, }: { children: React.ReactNode; order?: number; } ) => { return ( { ( fillProps: Fill.Props ) => { return createOrderedChildren( children, order, fillProps ); } } ); }; ExperimentalWooTaskListFooterItem.Slot = ( { fillProps, }: { fillProps?: Slot.Props; } ) => ( { sortFillsByOrder } );