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

Function noteAccessories

integrations/raycast/src/search-notes.tsx:410–430  ·  view source on GitHub ↗
(note: ZenNote)

Source from the content-addressed store, hash-verified

408}
409
410function noteAccessories(note: ZenNote): List.Item.Accessory[] {
411 const accessories: List.Item.Accessory[] = [
412 { text: note.folder },
413 { text: formatRelativeAge(note.updatedAt) },
414 ];
415
416 if (note.hasAttachments) {
417 accessories.splice(1, 0, {
418 icon: { source: Icon.Paperclip, tintColor: Color.SecondaryText },
419 tooltip: "Has attachments",
420 });
421 }
422
423 for (const tag of note.tags.slice(0, 2)) {
424 accessories.splice(accessories.length - 1, 0, {
425 tag: { value: `#${tag}`, color: Color.SecondaryText },
426 });
427 }
428
429 return accessories;
430}
431
432function formatRelativeAge(updatedAt: number): string {
433 if (!updatedAt) return "";

Callers 1

SearchNotesFunction · 0.85

Calls 1

formatRelativeAgeFunction · 0.70

Tested by

no test coverage detected