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