@ozen-ui/kit
Version:
React component library
18 lines (17 loc) • 614 B
JavaScript
import { __read } from "tslib";
import { classnames } from '@bem-react/classnames';
export var useGenerateMaxWidthCn = function (cn, maxWidth) {
if (typeof maxWidth === 'string') {
return cn({ maxWidth: maxWidth });
}
if (typeof maxWidth === 'object') {
return classnames(Object.entries(maxWidth)
.reduce(function (acc, _a) {
var _b;
var _c = __read(_a, 2), key = _c[0], value = _c[1];
return "".concat(acc, " ").concat(cn((_b = {}, _b["maxWidth_".concat(key)] = value, _b)));
}, '')
.trim());
}
return '';
};