okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
0b3299a01
main
1/** A small note model for the Fieldnotes prototype. */ 2export interface Note { 3id :string ; 4title :string ; 5body :string ; 6updatedAt :string ; 7pinned :boolean ; 8} 9 10export function createNote ( title = 'A new idea' ) :Note { 11return { 12id :crypto . randomUUID (), 13 title, 14body :'' , 15updatedAt :new Date (). toISOString (), 16pinned :false , 17}; 18} 19 20export function recentNotes ( notes :Note []) :Note [] { 21return [ ...notes ]. sort (( a , b ) => 22Number ( b . pinned ) - Number ( a . pinned ) || 23b . updatedAt . localeCompare ( a . updatedAt ) 24); 25}