import React from 'react'; import { PropTypes } from 'react'; export interface BreadcrumbItemProps { prefixCls?: string; separator?: React.ReactNode; href?: string; } export default class BreadcrumbItem extends React.Component { static __ANT_BREADCRUMB_ITEM = true; static defaultProps = { prefixCls: 'ant-breadcrumb', separator: '/', }; static propTypes = { prefixCls: PropTypes.string, separator: PropTypes.oneOfType([ PropTypes.string, PropTypes.element, ]), href: PropTypes.string, }; render() { const { prefixCls, separator, children, ...restProps } = this.props; let link; if ('href' in this.props) { link = {children}; } else { link = {children}; } if (children) { return ( {link} {separator} ); } return null; } }