From ca8300b27cb7a9db8eb47685531b51bd9c921add Mon Sep 17 00:00:00 2001 From: Project_IO Date: Thu, 20 Mar 2025 17:51:28 +0900 Subject: [PATCH] feat: middle save --- src/components/navigation/index.tsx | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) 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} + >> + + ); + })} +
+ ); }