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-12-01 14:33:51 +08:00
|
|
|
type CompoundedComponent = React.FC<{ children?: React.ReactNode }> & {
|
2022-09-30 14:26:41 +08:00
|
|
|
/** @internal */
|
2020-05-28 15:22:00 +08:00
|
|
|
__ANT_BREADCRUMB_SEPARATOR: boolean;
|
2022-12-01 14:33:51 +08:00
|
|
|
};
|
2019-07-25 12:02:15 +08:00
|
|
|
|
2022-12-01 14:33:51 +08:00
|
|
|
const BreadcrumbSeparator: CompoundedComponent = ({ children }) => {
|
2020-05-28 15:22:00 +08:00
|
|
|
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;
|