woocommerce/plugins/woocommerce-admin/client/task-lists/components/progress-header/progress-header.tsx

30 lines
719 B
TypeScript
Raw Normal View History

/**
* External dependencies
*/
import { useSlot } from '@woocommerce/experimental';
/**
* Internal dependencies
*/
import './progress-header.scss';
import {
WC_TASKLIST_EXPERIMENTAL_PROGRESS_HEADER_SLOT_NAME,
WooTaskListProgressHeaderItem,
} from './utils';
import {
DefaultProgressHeader,
DefaultProgressHeaderProps,
} from './default-progress-header';
export const ProgressHeader: React.FC< DefaultProgressHeaderProps > = ( {
taskListId,
} ) => {
const slot = useSlot( WC_TASKLIST_EXPERIMENTAL_PROGRESS_HEADER_SLOT_NAME );
return Boolean( slot?.fills?.length ) ? (
<WooTaskListProgressHeaderItem.Slot fillProps={ { taskListId } } />
) : (
<DefaultProgressHeader taskListId={ taskListId } />
);
};