mirror of
https://github.com/outbackdingo/openapi-ui.git
synced 2026-01-27 18:19:50 +00:00
{i} in breadcrumbs
This commit is contained in:
@@ -9,6 +9,7 @@ type TManageableBreadCrumbsProps = {
|
||||
}
|
||||
|
||||
export const ManageableBreadcrumbs: FC<TManageableBreadCrumbsProps> = ({ idToCompare, inside }) => {
|
||||
const location = useLocation()
|
||||
const { pathname } = useLocation()
|
||||
const params = useParams()
|
||||
const clusterName = params?.clusterName || ''
|
||||
@@ -21,6 +22,13 @@ export const ManageableBreadcrumbs: FC<TManageableBreadCrumbsProps> = ({ idToCom
|
||||
const apiExtensionVersion = params?.apiExtensionVersion || ''
|
||||
const crdName = params?.crdName || ''
|
||||
|
||||
const replaceValuesPartsOfUrls = location.pathname
|
||||
.split('/')
|
||||
.reduce<Record<string, string | undefined>>((acc, value, index) => {
|
||||
acc[index.toString()] = value
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
return (
|
||||
<ManageableBreadcrumbsWithDataProvider
|
||||
idToCompare={idToCompare}
|
||||
@@ -42,6 +50,7 @@ export const ManageableBreadcrumbs: FC<TManageableBreadCrumbsProps> = ({ idToCom
|
||||
entryName,
|
||||
apiExtensionVersion,
|
||||
crdName,
|
||||
...replaceValuesPartsOfUrls,
|
||||
}}
|
||||
pathname={pathname}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user