woocommerce/plugins/woocommerce-blocks/assets/js/blocks/mini-cart/mini-cart-contents/inner-blocks/utils.ts

17 lines
314 B
TypeScript

type Variant = 'text' | 'contained' | 'outlined';
export const getVariant = (
className = '',
defaultVariant: Variant
): Variant => {
if ( className.includes( 'is-style-outline' ) ) {
return 'outlined';
}
if ( className.includes( 'is-style-fill' ) ) {
return 'contained';
}
return defaultVariant;
};