17 lines
314 B
TypeScript
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;
|
||
|
};
|