import React, { useContext } from 'react';
import { ConfigProvider, Menu } from 'antd';
import classNames from 'classnames';
import './style/index.less';

export interface MenuDividerProps {
  className?: string;
  prefixCls?: string;
  style?: React.CSSProperties;
  dashed?: boolean;
}

const AntdMenuDivider = Menu.Divider;
const Divider = (props: MenuDividerProps) => {
  // 为了与 antd 的生态保持兼容性，我们要求必须要使用 `.@{ant-prefix}` 变量来生成类名
  const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
  const prefixCls = getPrefixCls('btri-menu');

  return (
    <AntdMenuDivider
      {...props}
      className={classNames(`${prefixCls}-divider`)}
    ></AntdMenuDivider>
  );
};
export default Divider;
