MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / NoteActions

Function NoteActions

integrations/raycast/src/search-notes.tsx:229–296  ·  view source on GitHub ↗
({
  note,
  vaultRoot,
  onDelete,
  onUpdate,
  onRefresh,
}: {
  note: ZenNote;
  vaultRoot: string | null;
  onDelete: (path: string) => void;
  onUpdate: (oldPath: string, updatedNote: ZenNote) => void;
  onRefresh: () => Promise<void>;
})

Source from the content-addressed store, hash-verified

227}
228
229function NoteActions({
230 note,
231 vaultRoot,
232 onDelete,
233 onUpdate,
234 onRefresh,
235}: {
236 note: ZenNote;
237 vaultRoot: string | null;
238 onDelete: (path: string) => void;
239 onUpdate: (oldPath: string, updatedNote: ZenNote) => void;
240 onRefresh: () => Promise<void>;
241}): ReactElement {
242 const noteAbsPath = absoluteNotePath(vaultRoot, note.path);
243
244 return (
245 <ActionPanel>
246 <Action
247 title="Open in ZenNotes"
248 icon={Icon.ArrowRight}
249 onAction={() => void openNoteInZenNotes(note)}
250 />
251 <Action
252 title="Open in Floating Window"
253 icon={Icon.AppWindow}
254 shortcut={{ modifiers: ["cmd", "shift"], key: "return" }}
255 onAction={() => void openNoteInFloatingWindow(note)}
256 />
257 {noteAbsPath ? <Action.ShowInFinder path={noteAbsPath} /> : null}
258 <Action.CopyToClipboard title="Copy Note Path" content={note.path} />
259 <Action.CopyToClipboard
260 title="Copy Wikilink"
261 content={`[[${note.title}]]`}
262 />
263 <ActionPanel.Section title="Manage">
264 {note.folder === "archive" ? (
265 <Action
266 title="Unarchive Note"
267 icon={Icon.ArrowCounterClockwise}
268 onAction={() =>
269 void updateNoteArchiveState(note, "unarchive", onUpdate)
270 }
271 />
272 ) : (
273 <Action
274 title="Archive Note"
275 icon={Icon.Box}
276 onAction={() =>
277 void updateNoteArchiveState(note, "archive", onUpdate)
278 }
279 />
280 )}
281 <Action
282 title="Move to Trash"
283 icon={Icon.Trash}
284 style={Action.Style.Destructive}
285 shortcut={{ modifiers: ["cmd"], key: "backspace" }}
286 onAction={() => void moveNoteToTrash(note, onDelete)}

Callers

nothing calls this directly

Calls 5

absoluteNotePathFunction · 0.90
openNoteInZenNotesFunction · 0.90
openNoteInFloatingWindowFunction · 0.90
updateNoteArchiveStateFunction · 0.85
moveNoteToTrashFunction · 0.85

Tested by

no test coverage detected