2023-03-13 12:00:02 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2023-03-13 12:00:02 +00:00
|
|
|
import {
|
|
|
|
Cart,
|
|
|
|
CartShippingPackageShippingRate,
|
|
|
|
} from '@woocommerce/type-defs/cart';
|
|
|
|
import { Component } from '@wordpress/element';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { createSlotFill } from '../../slot';
|
2023-10-23 14:59:19 +00:00
|
|
|
import type { RadioControlOption } from '../../../../packages/components/radio-control/types';
|
2023-03-13 12:00:02 +00:00
|
|
|
|
|
|
|
const slotName = '__experimentalOrderLocalPickupPackages';
|
|
|
|
const {
|
|
|
|
Fill: ExperimentalOrderLocalPickupPackages,
|
|
|
|
Slot: OrderLocalPickupPackagesSlot,
|
|
|
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
|
|
} = createSlotFill( slotName );
|
|
|
|
|
|
|
|
interface ExperimentalOrderLocalPickupPackagesProps {
|
|
|
|
extensions: Record< string, unknown >;
|
|
|
|
cart: Cart;
|
|
|
|
components: Record< string, Component >;
|
|
|
|
renderPickupLocation: (
|
|
|
|
option: CartShippingPackageShippingRate,
|
|
|
|
packageCount: number
|
|
|
|
) => RadioControlOption;
|
|
|
|
}
|
|
|
|
const Slot = ( {
|
|
|
|
extensions,
|
|
|
|
cart,
|
|
|
|
components,
|
|
|
|
renderPickupLocation,
|
|
|
|
}: ExperimentalOrderLocalPickupPackagesProps ) => {
|
|
|
|
return (
|
|
|
|
<OrderLocalPickupPackagesSlot
|
2024-05-31 03:49:36 +00:00
|
|
|
className={ clsx(
|
2023-03-13 12:00:02 +00:00
|
|
|
'wc-block-components-local-pickup-rates-control'
|
|
|
|
) }
|
|
|
|
fillProps={ {
|
|
|
|
extensions,
|
|
|
|
cart,
|
|
|
|
components,
|
|
|
|
renderPickupLocation,
|
|
|
|
} }
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ExperimentalOrderLocalPickupPackages.Slot = Slot;
|
|
|
|
|
|
|
|
export default ExperimentalOrderLocalPickupPackages;
|