epn-ui
Version:
Дизайн система кабинета ВМ
19 lines (16 loc) • 928 B
JavaScript
import React, { useEffect } from 'react';
import Empty$1 from 'antd/lib/empty';
import clsx from 'clsx';
import useI18n from '../../i18n/index.js';
var BaseEmpty = function (_a) {
var _b = _a.showImage, showImage = _b === void 0 ? false : _b, _c = _a.description, description = _c === void 0 ? 'Nothing found' : _c, image = _a.image, imageStyle = _a.imageStyle, className = _a.className, children = _a.children, locale = _a.locale;
var _d = useI18n(), t = _d.t, changeLanguage = _d.changeLanguage;
useEffect(function () {
changeLanguage(locale);
}, [locale]);
return (React.createElement(Empty$1, { description: description || t('Nothing found'), image: showImage ? image : null, imageStyle: imageStyle, className: clsx('epn-empty', className, {
'epn-empty-withoutImage': !showImage,
}) }, children));
};
var Empty = BaseEmpty;
export { BaseEmpty, Empty as default };