client/calendar collection: add "Archive note" command to the context menu

This commit is contained in:
Adorian Doran
2025-12-01 13:29:28 +02:00
parent e69b5988ec
commit 90b5282b39
4 changed files with 34 additions and 31 deletions

View File

@@ -0,0 +1,21 @@
import { t } from "../services/i18n"
import attributes from "../services/attributes"
import FNote from "../entities/fnote"
export function getArchiveMenuItem(note: FNote) {
if (!note.isArchived) {
return {
title: t("board_view.archive-note"),
uiIcon: "bx bx-archive",
handler: () => attributes.addLabel(note.noteId, "archived")
}
} else {
return {
title: t("board_view.unarchive-note"),
uiIcon: "bx bx-archive-out",
handler: async () => {
attributes.removeOwnedLabelByName(note, "archived")
}
}
}
}