Bread Crumb multiple routs

Hello,
I have got a question about the bread crumb.
How to use the bread crumb in components with multiple routes?

Example
@page "/detailerror/car"
@page "/allerrors/detailerror/car"

Now the bread crumb should be
detailerror => car
allerrors => detailerror => car
depending which route i use

Is there an easy way to achive this?

You can use the NavigationManager to determine the current URL and act accordingly:

var currentUrl = NavigationManager.ToBaseRelativePath(NavigationManager.Uri);

You need to have a NavigationManager injected in your page first.