import { __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { useContext } from 'react';
import cls from 'clsx';
import ConfigProviderContext from '../config-provider/ConfigProviderContext';

const Divider = _a => {
  var {
    children,
    className,
    hairline,
    dashed,
    contentPosition
  } = _a,
      props = __rest(_a, ["children", "className", "hairline", "dashed", "contentPosition"]);

  const {
    prefixCls,
    createNamespace
  } = useContext(ConfigProviderContext);
  const [bem] = createNamespace('divider', prefixCls);
  return _jsx("div", Object.assign({
    role: "separator",
    className: cls(className, bem({
      dashed,
      hairline,
      [`content-${contentPosition}`]: !!children
    }))
  }, props, {
    children: children
  }));
};

Divider.defaultProps = {
  hairline: true,
  contentPosition: 'center'
};
export default Divider;