ant-design/components/breadcrumb/BreadcrumbSeparator.tsx

19 lines
597 B
TypeScript
Raw Normal View History

2019-07-25 12:02:15 +08:00
import * as React from 'react';
import { ConfigContext } from '../config-provider';
2019-07-25 12:02:15 +08:00
interface BreadcrumbSeparatorInterface extends React.FC<{ children?: React.ReactNode }> {
/** @internal */
__ANT_BREADCRUMB_SEPARATOR: boolean;
}
2019-07-25 12:02:15 +08:00
const BreadcrumbSeparator: BreadcrumbSeparatorInterface = ({ children }) => {
const { getPrefixCls } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('breadcrumb');
2019-07-25 12:02:15 +08:00
return <span className={`${prefixCls}-separator`}>{children || '/'}</span>;
};
2019-07-25 12:02:15 +08:00
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
export default BreadcrumbSeparator;