fix: handle root path in breadcrumb parsing for PathInput component

- Added logic to correctly parse and return the root path for Unix-like systems in the breadcrumb segment function.
This commit is contained in:
Illia Filippov
2025-12-24 19:50:57 +01:00
parent 9dee9fb366
commit 60d4b5c877

View File

@@ -22,6 +22,11 @@ interface BreadcrumbSegment {
function parseBreadcrumbs(path: string): BreadcrumbSegment[] {
if (!path) return [];
// Handle root path on Unix-like systems
if (path === '/') {
return [{ name: '/', path: '/', isLast: true }];
}
const segments = path.split(/[/\\]/).filter(Boolean);
const isWindows = segments[0]?.includes(':');