2021-01-11 12:12:26 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import classnames from 'classnames';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2021-10-12 14:23:52 +00:00
|
|
|
import { createSlotFill, hasValidFills, useSlot } from '../../slot';
|
|
|
|
import TotalsWrapper from '../totals-wrapper';
|
2021-01-11 12:12:26 +00:00
|
|
|
|
|
|
|
const slotName = '__experimentalOrderMeta';
|
|
|
|
|
2021-02-08 11:37:55 +00:00
|
|
|
const { Fill: ExperimentalOrderMeta, Slot: OrderMetaSlot } = createSlotFill(
|
|
|
|
slotName
|
|
|
|
);
|
2021-01-11 12:12:26 +00:00
|
|
|
|
2022-02-22 09:33:52 +00:00
|
|
|
const Slot = ( { className, extensions, cart, context } ) => {
|
2021-07-02 14:56:39 +00:00
|
|
|
const { fills } = useSlot( slotName );
|
2021-01-11 12:12:26 +00:00
|
|
|
return (
|
2021-07-02 14:56:39 +00:00
|
|
|
hasValidFills( fills ) && (
|
|
|
|
<TotalsWrapper slotWrapper={ true }>
|
|
|
|
<OrderMetaSlot
|
|
|
|
className={ classnames(
|
|
|
|
className,
|
|
|
|
'wc-block-components-order-meta'
|
|
|
|
) }
|
2022-02-22 09:33:52 +00:00
|
|
|
fillProps={ { extensions, cart, context } }
|
2021-07-02 14:56:39 +00:00
|
|
|
/>
|
|
|
|
</TotalsWrapper>
|
|
|
|
)
|
2021-01-11 12:12:26 +00:00
|
|
|
);
|
2021-02-08 11:37:55 +00:00
|
|
|
};
|
2021-01-11 12:12:26 +00:00
|
|
|
|
|
|
|
ExperimentalOrderMeta.Slot = Slot;
|
|
|
|
|
|
|
|
export default ExperimentalOrderMeta;
|