woocommerce/plugins/woocommerce-blocks/packages/checkout/components/order-meta/index.js

38 lines
797 B
JavaScript
Raw Normal View History

/**
* External dependencies
*/
import classnames from 'classnames';
/**
* Internal dependencies
*/
import { createSlotFill, hasValidFills, useSlot } from '../../slot';
import TotalsWrapper from '../totals-wrapper';
const slotName = '__experimentalOrderMeta';
const { Fill: ExperimentalOrderMeta, Slot: OrderMetaSlot } = createSlotFill(
slotName
);
const Slot = ( { className, extensions, cart } ) => {
const { fills } = useSlot( slotName );
return (
hasValidFills( fills ) && (
<TotalsWrapper slotWrapper={ true }>
<OrderMetaSlot
className={ classnames(
className,
'wc-block-components-order-meta'
) }
fillProps={ { extensions, cart } }
/>
</TotalsWrapper>
)
);
};
ExperimentalOrderMeta.Slot = Slot;
export default ExperimentalOrderMeta;