mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 23:18:36 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
30 lines
819 B
TypeScript
30 lines
819 B
TypeScript
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> = (props) => {
|
|
const { prefixCls: customizePrefixCls, className, dashed, ...restProps } = props;
|
|
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;
|