mirror of
https://github.com/zadam/trilium.git
synced 2025-12-20 22:34:23 +01:00
feat(right_pane_widget): handle zero headings
This commit is contained in:
parent
fad6414e1d
commit
6da42fac20
@ -1796,7 +1796,8 @@
|
|||||||
},
|
},
|
||||||
"toc": {
|
"toc": {
|
||||||
"table_of_contents": "Table of Contents",
|
"table_of_contents": "Table of Contents",
|
||||||
"options": "Options"
|
"options": "Options",
|
||||||
|
"no_headings": "No headings."
|
||||||
},
|
},
|
||||||
"watched_file_update_status": {
|
"watched_file_update_status": {
|
||||||
"file_last_modified": "File <code class=\"file-path\"></code> has been last modified on <span class=\"file-last-modified\"></span>.",
|
"file_last_modified": "File <code class=\"file-path\"></code> has been last modified on <span class=\"file-last-modified\"></span>.",
|
||||||
|
|||||||
@ -40,9 +40,13 @@ function AbstractTableOfContents<T extends RawHeading>({ headings, scrollToHeadi
|
|||||||
const nestedHeadings = buildHeadingTree(headings);
|
const nestedHeadings = buildHeadingTree(headings);
|
||||||
return (
|
return (
|
||||||
<span className="toc">
|
<span className="toc">
|
||||||
<ol>
|
{nestedHeadings.length > 0 ? (
|
||||||
{nestedHeadings.map(heading => <TableOfContentsHeading key={heading.id} heading={heading} scrollToHeading={scrollToHeading} />)}
|
<ol>
|
||||||
</ol>
|
{nestedHeadings.map(heading => <TableOfContentsHeading key={heading.id} heading={heading} scrollToHeading={scrollToHeading} />)}
|
||||||
|
</ol>
|
||||||
|
) : (
|
||||||
|
<div className="no-headings">{t("toc.no_headings")}</div>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user