mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-30 06:09:34 +08:00
23 lines
582 B
TypeScript
23 lines
582 B
TypeScript
import * as React from 'react';
|
|
import classNames from 'classnames';
|
|
|
|
export default function Divider({
|
|
prefixCls = 'ant',
|
|
type = 'horizontal',
|
|
className,
|
|
children,
|
|
dashed,
|
|
...restProps,
|
|
}) {
|
|
const classString = classNames(
|
|
className, `${prefixCls}-divider`, `${prefixCls}-divider-${type}`, {
|
|
[`${prefixCls}-divider-with-text`]: children,
|
|
[`${prefixCls}-divider-dashed`]: !!dashed,
|
|
});
|
|
return (
|
|
<div className={classString} {...restProps}>
|
|
{children && <span className={`${prefixCls}-divider-inner-text`}>{children}</span>}
|
|
</div>
|
|
);
|
|
}
|