2023-04-17 21:07:25 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { useSlot } from '@woocommerce/experimental';
|
2024-05-31 03:49:36 +00:00
|
|
|
import clsx from 'clsx';
|
2023-04-17 21:07:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import {
|
|
|
|
EXPERIMENTAL_WC_HOMESCREEN_WC_PAY_FEATURE_SLOT_NAME,
|
|
|
|
WooHomescreenWCPayFeatureItem,
|
|
|
|
} from './utils';
|
|
|
|
|
|
|
|
export const WooHomescreenWCPayFeature = ( {
|
|
|
|
className,
|
|
|
|
}: {
|
|
|
|
className: string;
|
|
|
|
} ) => {
|
|
|
|
const slot = useSlot( EXPERIMENTAL_WC_HOMESCREEN_WC_PAY_FEATURE_SLOT_NAME );
|
|
|
|
const hasFills = Boolean( slot?.fills?.length );
|
|
|
|
|
|
|
|
if ( ! hasFills ) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return (
|
2024-05-31 03:49:36 +00:00
|
|
|
<div className={ clsx( 'woocommerce-homescreen__header', className ) }>
|
2023-04-17 21:07:25 +00:00
|
|
|
<WooHomescreenWCPayFeatureItem.Slot />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|