File "index.tsx"

Full Path: /home/warrior1/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/packages/checkout/components/totals-wrapper/index.tsx
File size: 709 bytes
MIME-type: text/x-java
Charset: utf-8

/**
 * External dependencies
 */
import classnames from 'classnames';
import { Children, ReactNode } from 'react';

/**
 * Internal dependencies
 */
import './style.scss';

interface TotalsWrapperProps {
	children: ReactNode;
	/* If this TotalsWrapper is being used to wrap a Slot */
	slotWrapper?: boolean;
	className?: string;
}

const TotalsWrapper = ( {
	children,
	slotWrapper = false,
	className,
}: TotalsWrapperProps ): JSX.Element | null => {
	return Children.count( children ) ? (
		<div
			className={ classnames(
				className,
				'wc-block-components-totals-wrapper',
				{
					'slot-wrapper': slotWrapper,
				}
			) }
		>
			{ children }
		</div>
	) : null;
};

export default TotalsWrapper;