2017-08-19 12:39:11 +08:00
|
|
|
import React from 'react';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
export default function Divider({
|
|
|
|
prefixCls = 'ant',
|
|
|
|
type = 'horizontal',
|
|
|
|
className,
|
|
|
|
children,
|
2017-10-26 20:59:36 +08:00
|
|
|
dashed,
|
2017-08-19 12:39:11 +08:00
|
|
|
...restProps,
|
|
|
|
}) {
|
2017-10-26 20:59:36 +08:00
|
|
|
const classString = classNames(
|
|
|
|
className, `${prefixCls}-divider`, `${prefixCls}-divider-${type}`, {
|
2017-08-19 12:39:11 +08:00
|
|
|
[`${prefixCls}-divider-with-text`]: children,
|
2017-10-26 20:59:36 +08:00
|
|
|
[`${prefixCls}-divider-dashed`]: !!dashed,
|
2017-08-19 12:39:11 +08:00
|
|
|
});
|
|
|
|
return (
|
|
|
|
<div className={classString} {...restProps}>
|
|
|
|
{children && <span className={`${prefixCls}-divider-inner-text`}>{children}</span>}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|