diff --git a/src/components/navigation/index.tsx b/src/components/navigation/index.tsx index be8c829..cafbdf3 100644 --- a/src/components/navigation/index.tsx +++ b/src/components/navigation/index.tsx @@ -2,9 +2,29 @@ import { useLocation } from "react-router"; export function FileNavigator() { const location = useLocation(); - const split = location.pathname.substring(1, location.pathname.length).split("/"); + const split = location.pathname === "/" ? Array() : location.pathname.substring(1, location.pathname.length).split("/"); - return
- -
; + return ( +
+ + Index Directory + + {split.map((path, i) => { + if (i === split.length - 1) { + return ( + + {path} + + ); + } + + return ( + + {path} + >> + + ); + })} +
+ ); }