mirror of
https://github.com/zadam/trilium.git
synced 2025-12-15 12:49:53 +01:00
21 lines
643 B
TypeScript
21 lines
643 B
TypeScript
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")
|
|
}
|
|
}
|
|
}
|
|
} |