mirror of
https://github.com/zadam/trilium.git
synced 2025-12-28 18:24:27 +01:00
refactor(client): remove items array
This commit is contained in:
parent
2ac3d3aaed
commit
a4f34ce6c5
@ -21,21 +21,17 @@ export default function NoteTitleActions() {
|
||||
const isHiddenNote = note && note.noteId !== "_search" && note.noteId.startsWith("_");
|
||||
const noteType = useNoteProperty(note, "type");
|
||||
|
||||
const items = [
|
||||
note && <PromotedAttributes note={note} componentId={componentId} noteContext={noteContext} />,
|
||||
note && noteType === "search" && <SearchProperties note={note} ntxId={ntxId} />,
|
||||
note && !isHiddenNote && noteType === "book" && <CollectionProperties note={note} />
|
||||
].filter(Boolean);
|
||||
|
||||
return (
|
||||
<div className={clsx("title-actions", items.length > 0 && "visible")}>
|
||||
{items}
|
||||
<div className="title-actions">
|
||||
<PromotedAttributes note={note} componentId={componentId} noteContext={noteContext} />
|
||||
{noteType === "search" && <SearchProperties note={note} ntxId={ntxId} />}
|
||||
{!isHiddenNote && note && noteType === "book" && <CollectionProperties note={note} />}
|
||||
<EditedNotes />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function SearchProperties({ note, ntxId }: { note: FNote, ntxId: string | null | undefined }) {
|
||||
function SearchProperties({ note, ntxId }: { note: FNote | null | undefined, ntxId: string | null | undefined }) {
|
||||
return (note &&
|
||||
<Collapsible
|
||||
title={t("search_definition.search_parameters")}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user