feat: middle save
This commit is contained in:
parent
536af9b0e0
commit
ca8300b27c
1 changed files with 24 additions and 4 deletions
|
@ -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<string>() : location.pathname.substring(1, location.pathname.length).split("/");
|
||||
|
||||
return <div>
|
||||
return (
|
||||
<div>
|
||||
<a href="/">
|
||||
<span>Index Directory</span>
|
||||
</a>
|
||||
{split.map((path, i) => {
|
||||
if (i === split.length - 1) {
|
||||
return (
|
||||
<a key={i}>
|
||||
<span>{path}</span>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
</div>;
|
||||
return (
|
||||
<a key={i} href="">
|
||||
<span>{path}</span>
|
||||
<span>>></span>
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue