@i-novus/ui-core
Version:
Базовые UI компоненты
16 lines (15 loc) • 727 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import classNames from 'classnames';
import { useConfigProvider } from '../../core';
import { Link } from '../../general/Typography/Link';
export const Crumb = ({ children, path, prefix, style, className, disabled = false, tag: Tag = Link, visible = true, }) => {
const { getPrefix } = useConfigProvider();
const prefixCls = getPrefix(prefix);
if (!children || !visible) {
return null;
}
return (_jsx(Tag, { style: style, className: classNames(className, `${prefixCls}-crumb`, {
[`${prefixCls}-crumb_disabled`]: !path || disabled,
}), to: path, disabled: !path || disabled, children: children }));
};
Crumb.displayName = 'Crumb';