2021-01-11 12:12:26 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2021-01-11 12:12:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2024-05-16 09:46:24 +00:00
|
|
|
import { createSlotFill, hasValidFills, useSlotFills } from '../../slot';
|
2023-11-20 12:53:41 +00:00
|
|
|
import TotalsWrapper from '../../../components/totals-wrapper';
|
2021-01-11 12:12:26 +00:00
|
|
|
|
|
|
|
const slotName = '__experimentalOrderMeta';
|
|
|
|
|
2022-06-15 09:56:52 +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 } ) => {
|
2024-05-16 09:46:24 +00:00
|
|
|
const fills = useSlotFills( slotName );
|
|
|
|
|
2021-01-11 12:12:26 +00:00
|
|
|
return (
|
2021-07-02 14:56:39 +00:00
|
|
|
hasValidFills( fills ) && (
|
|
|
|
<TotalsWrapper slotWrapper={ true }>
|
|
|
|
<OrderMetaSlot
|
2024-05-31 03:49:36 +00:00
|
|
|
className={ clsx(
|
2021-07-02 14:56:39 +00:00
|
|
|
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;
|