diff --git a/src/components/Breadcrumb/index.tsx b/src/components/Breadcrumb/index.tsx index a42e563..fa147e9 100644 --- a/src/components/Breadcrumb/index.tsx +++ b/src/components/Breadcrumb/index.tsx @@ -32,7 +32,7 @@ function flatten([ export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) { const paths = relativePath.split("/") const breadcrumbItems = flatten([traversePaths(paths, basePath)]) - + let count = 0; return ( @@ -52,14 +52,25 @@ export function Breadcrumb({ relativePath, basePath }: IBreadcrumbProps) { /> + {breadcrumbItems.map(item => { if (item.type === "folder") { - return ( + count++; + if (count > 1) { + return ( - + { item.title } - ) + ) + } else { + return ( + + + + + ) + } } return (