refactor(client): remove items array

This commit is contained in:
Elian Doran 2025-12-23 19:55:50 +02:00
parent 2ac3d3aaed
commit a4f34ce6c5
No known key found for this signature in database

View File

@ -21,21 +21,17 @@ export default function NoteTitleActions() {
const isHiddenNote = note && note.noteId !== "_search" && note.noteId.startsWith("_"); const isHiddenNote = note && note.noteId !== "_search" && note.noteId.startsWith("_");
const noteType = useNoteProperty(note, "type"); 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 ( return (
<div className={clsx("title-actions", items.length > 0 && "visible")}> <div className="title-actions">
{items} <PromotedAttributes note={note} componentId={componentId} noteContext={noteContext} />
{noteType === "search" && <SearchProperties note={note} ntxId={ntxId} />}
{!isHiddenNote && note && noteType === "book" && <CollectionProperties note={note} />}
<EditedNotes /> <EditedNotes />
</div> </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 && return (note &&
<Collapsible <Collapsible
title={t("search_definition.search_parameters")} title={t("search_definition.search_parameters")}