/** * External dependencies */ import { Slot, Fill } from '@wordpress/components'; import { sortFillsByOrder, createOrderedChildren, } from '@woocommerce/components'; export const EXPERIMENTAL_WC_CYS_TRANSITIONAL_PAGE_SECONDARY_BUTTON_SLOT_NAME = 'customize_your_store_transitional_page_secondary_button'; /** * Create a Fill for extensions to add a secondary button to the transitional page. * * @slotFill WooCYSSecondaryButton * @scope woocommerce-admin * @example * const MyButton = () => ( * * * * ); * * registerPlugin( 'my-extension', { * render: MyButton, * scope: 'woocommerce-admin', * } ); * @param {Object} param0 * @param {Array} param0.children - Node children. * @param {Array} param0.order - Node order. */ export const WooCYSSecondaryButton: React.FC< { children?: React.ReactNode; order?: number; } > & { Slot: React.FC< Slot.Props >; } = ( { children, order = 1 } ) => { return ( { ( fillProps: Fill.Props ) => { return createOrderedChildren( children, order, fillProps ); } } ); }; WooCYSSecondaryButton.Slot = ( { fillProps } ) => ( { sortFillsByOrder } );