2023-05-06 15:49:37 +08:00
|
|
|
import * as React from 'react';
|
2024-04-08 14:04:08 +08:00
|
|
|
|
2020-05-28 15:22:00 +08:00
|
|
|
import { ConfigContext } from '../config-provider';
|
2019-07-25 12:02:15 +08:00
|
|
|
|
2024-04-09 16:49:47 +08:00
|
|
|
type CompoundedComponent = React.FC<React.PropsWithChildren> & {
|
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');
|
2023-02-22 10:40:08 +08:00
|
|
|
return (
|
|
|
|
<li className={`${prefixCls}-separator`} aria-hidden="true">
|
2023-02-24 18:20:28 +08:00
|
|
|
{children === '' ? children : children || '/'}
|
2023-02-22 10:40:08 +08:00
|
|
|
</li>
|
|
|
|
);
|
2020-05-28 15:22:00 +08:00
|
|
|
};
|
2019-07-25 12:02:15 +08:00
|
|
|
|
2020-05-28 15:22:00 +08:00
|
|
|
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
|
|
|
|
|
|
|
|
export default BreadcrumbSeparator;
|