Call createNote() to add a new entry, or use archiveNote(id) to move older entries out of the active view.

notes.ts
1 export type Note = {
2 id: string;
3 title: string;
4 body: string;
5 createdAt: Date;
6 }
8 export function createNote(title: string, body: string): Note {
9 return { id: crypto.randomUUID(), title, body, createdAt: new Date() };
10 }