cainthus-alex-library
Version:
Component React library for Cainthus - Alex Dashboard
15 lines (14 loc) • 458 B
text/typescript
export const addClassNameWithModifiers = (
componentIdentifier: string,
...modifiers: string[]
) : string => {
return modifiers.reduce((acc: string, curr: string) => {
const modifier = curr ? ` ${componentIdentifier}_${curr}` : '';
return `${acc}${modifier}`;
}, componentIdentifier);
};
export const addClassNames = (...classNames: string[]): string => {
return classNames.reduce((acc, curr) => {
return `${acc} ${curr}`;
}, '');
};