import * as React from 'react' ; import classNames from 'classnames' ; import { DivideProps } from './interface' ; import './style/index.scss' ; const defaultProps = { type : 'horizontal' , orientation : 'center' , dashed : false } ; const prefixCls = 'cp-ui-divider' ; const getClassNames = ( { type , orientation , dashed , className , children } ) => { return classNames ( prefixCls , className , { [ `${ prefixCls }-${ type }` ] : type , [ `${ prefixCls }-${ orientation }` ] : children ? orientation : false , [ `${ prefixCls }-dashed` ] : dashed } ) ; } ; const Divide = props => { const classStr = getClassNames ( props ) ; const { children } = props ; return ( < div className = { classStr } > { children ? < span className = { `${ prefixCls }-inner-text` } > { children } < /span> : null} < /div>); } ; Divide . defaultProps = defaultProps ; export default Divide ;