feat(breadcrumb): hide last note

This commit is contained in:
Elian Doran 2025-12-08 15:53:08 +02:00
parent d02ec47d77
commit 43ceb1982d
No known key found for this signature in database

View File

@ -6,7 +6,6 @@ import { joinElements } from "./react/react_utils";
export default function Breadcrumb() { export default function Breadcrumb() {
const { noteContext } = useNoteContext(); const { noteContext } = useNoteContext();
const notePath = buildNotePaths(noteContext?.notePathArray); const notePath = buildNotePaths(noteContext?.notePathArray);
console.log("Render with ", notePath);
return ( return (
<div className="breadcrumb"> <div className="breadcrumb">
@ -28,7 +27,7 @@ function buildNotePaths(notePathArray: string[] | undefined) {
let prefix = ""; let prefix = "";
const output: string[] = []; const output: string[] = [];
for (const notePath of notePathArray) { for (const notePath of notePathArray.slice(0, notePathArray.length - 1)) {
output.push(`${prefix}${notePath}`); output.push(`${prefix}${notePath}`);
prefix += `${notePath}/`; prefix += `${notePath}/`;
} }