ant-design/components/breadcrumb/BreadcrumbSeparator.tsx

23 lines
637 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
type CompoundedComponent = React.FC<{ children?: React.ReactNode }> & {
/** @internal */
__ANT_BREADCRUMB_SEPARATOR: boolean;
};
2019-07-25 12:02:15 +08:00
const BreadcrumbSeparator: CompoundedComponent = ({ children }) => {
const { getPrefixCls } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('breadcrumb');
2019-07-25 12:02:15 +08:00
2023-02-22 10:40:08 +08:00
return (
<li className={`${prefixCls}-separator`} aria-hidden="true">
{children === '' ? children : children || '/'}
2023-02-22 10:40:08 +08:00
</li>
);
};
2019-07-25 12:02:15 +08:00
BreadcrumbSeparator.__ANT_BREADCRUMB_SEPARATOR = true;
export default BreadcrumbSeparator;