diff --git a/components/carnet/notes-view.tsx b/components/carnet/notes-view.tsx index b2a9de8f..b6ccb588 100644 --- a/components/carnet/notes-view.tsx +++ b/components/carnet/notes-view.tsx @@ -8,10 +8,11 @@ import { fr } from 'date-fns/locale'; interface Note { id: string; title: string; - content: string; - lastEdited: Date; - category?: string; - tags?: string[]; + lastModified: string; + size: number; + type: string; + mime: string; + etag: string; } interface NotesViewProps { @@ -33,7 +34,7 @@ export const NotesView: React.FC = ({ onNoteSelect, currentFolde throw new Error('Failed to fetch notes'); } const data = await response.json(); - setNotes(data.files || []); + setNotes(data); } catch (err) { console.error('Error fetching notes:', err); setNotes([]); @@ -49,15 +50,18 @@ export const NotesView: React.FC = ({ onNoteSelect, currentFolde const newNote: Note = { id: Date.now().toString(), title: 'New Note', - content: '', - lastEdited: new Date() + lastModified: new Date().toISOString(), + size: 0, + type: 'file', + mime: 'text/markdown', + etag: '' }; setNotes([newNote, ...notes]); onNoteSelect?.(newNote); }; - const formatDate = (date: Date) => { - return format(date, 'EEEE d MMM yyyy, HH:mm', { locale: fr }); + const formatDate = (dateString: string) => { + return format(new Date(dateString), 'EEEE d MMM yyyy, HH:mm', { locale: fr }); }; const getFolderIcon = (folder: string) => { @@ -137,23 +141,11 @@ export const NotesView: React.FC = ({ onNoteSelect, currentFolde {note.title} - {note.tags?.map((tag) => ( - - {tag} - - ))}
- {formatDate(note.lastEdited)} - {note.content && ( - <> - - {note.content} - - )} + {formatDate(note.lastModified)} + + {note.size} bytes