You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
803 B

import * as React from 'react';
import classNames from 'classnames';
import { Divider } from 'rc-menu';
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> = ({
prefixCls: customizePrefixCls,
className,
dashed,
...restProps
}) => {
const { getPrefixCls } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('menu', customizePrefixCls);
const classString = classNames(
{
[`${prefixCls}-item-divider-dashed`]: !!dashed,
},
className,
);
return <Divider className={classString} {...restProps} />;
};
export default MenuDivider;