({
note,
vaultRoot,
onDelete,
onUpdate,
onRefresh,
}: {
note: ZenNote;
vaultRoot: string | null;
onDelete: (path: string) => void;
onUpdate: (oldPath: string, updatedNote: ZenNote) => void;
onRefresh: () => Promise<void>;
})
| 227 | } |
| 228 | |
| 229 | function 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)} |
nothing calls this directly
no test coverage detected