mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
* refactor: uninstall classnames & install clsx * refactor: uninstall classnames & install clsx * test: rename test fn * test: update snap * update * update * update * update * update snap * update * update --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: thinkasany <480968828@qq.com>
26 lines
793 B
TypeScript
26 lines
793 B
TypeScript
import * as React from 'react';
|
|
import { Divider } from '@rc-component/menu';
|
|
import { clsx } from 'clsx';
|
|
|
|
import { ConfigContext } from '../config-provider';
|
|
|
|
export interface MenuDividerProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
className?: string;
|
|
prefixCls?: string;
|
|
style?: React.CSSProperties;
|
|
dashed?: boolean;
|
|
}
|
|
|
|
const MenuDivider: React.FC<MenuDividerProps> = (props) => {
|
|
const { prefixCls: customizePrefixCls, className, dashed, ...restProps } = props;
|
|
const { getPrefixCls } = React.useContext(ConfigContext);
|
|
|
|
const prefixCls = getPrefixCls('menu', customizePrefixCls);
|
|
|
|
const classString = clsx({ [`${prefixCls}-item-divider-dashed`]: !!dashed }, className);
|
|
|
|
return <Divider className={classString} {...restProps} />;
|
|
};
|
|
|
|
export default MenuDivider;
|