diff --git a/components/carnet/navigation.tsx b/components/carnet/navigation.tsx index 7355d52d..3953ab76 100644 --- a/components/carnet/navigation.tsx +++ b/components/carnet/navigation.tsx @@ -1,7 +1,7 @@ "use client"; -import React from 'react'; -import { BookOpen, Tag, Trash2 } from 'lucide-react'; +import React, { useState } from 'react'; +import { Search, BookOpen, Tag, Trash2, Star, Archive, X } from 'lucide-react'; import { PaneLayout } from '@/app/carnet/page'; interface NavigationProps { @@ -9,37 +9,88 @@ interface NavigationProps { } export const Navigation: React.FC = ({ onLayoutChange }) => { + const [searchQuery, setSearchQuery] = useState(''); + return ( -
- {/* Header */} -
-

Navigation

+
+ {/* Search */} +
+
+ setSearchQuery(e.target.value)} + placeholder="Search tags..." + className="w-full pl-9 pr-4 py-2 bg-white border border-carnet-border rounded-md text-sm text-carnet-text-primary placeholder-carnet-text-muted focus:outline-none focus:ring-1 focus:ring-primary" + /> + + {searchQuery && ( + + )} +
{/* Navigation Items */}
-
onLayoutChange?.(PaneLayout.ItemSelection)} - > - -

All Notes

+
+
+
onLayoutChange?.(PaneLayout.ItemSelection)} + > + + Notes + 54 +
+ +
onLayoutChange?.(PaneLayout.TagSelection)} + > + + Starred +
+ +
+ + Archived + 18 +
+ +
onLayoutChange?.(PaneLayout.TableView)} + > + + Trash +
+
- -
onLayoutChange?.(PaneLayout.TagSelection)} - > - -

Tags

-
- -
onLayoutChange?.(PaneLayout.TableView)} - > - -

Trash

+ + {/* Favorites Section */} +
+

Favorites

+
+
+ Blogs + 2 +
+
+ Bugs + 1 +
+
+ Daily Notes + 7 +
+
diff --git a/components/carnet/notes-view.tsx b/components/carnet/notes-view.tsx index 8bbb042f..78d0c806 100644 --- a/components/carnet/notes-view.tsx +++ b/components/carnet/notes-view.tsx @@ -1,12 +1,17 @@ "use client"; import React, { useState } from 'react'; -import { Plus } from 'lucide-react'; +import { Plus, Search, X } from 'lucide-react'; +import { format } from 'date-fns'; +import { fr } from 'date-fns/locale'; interface Note { id: string; title: string; + content: string; lastEdited: Date; + category?: string; + tags?: string[]; } interface NotesViewProps { @@ -14,11 +19,15 @@ interface NotesViewProps { } export const NotesView: React.FC = ({ onNoteSelect }) => { + const [searchQuery, setSearchQuery] = useState(''); const [notes, setNotes] = useState([ { id: '1', - title: 'Sample Note', - lastEdited: new Date(Date.now() - 2 * 60 * 60 * 1000) // 2 hours ago + title: 'Budget and expenses', + content: 'Created with Secure Spreadsheets', + lastEdited: new Date('2022-03-24T19:16:00'), + category: 'Finance', + tags: ['Finance'] } ]); @@ -26,22 +35,54 @@ export const NotesView: React.FC = ({ onNoteSelect }) => { const newNote: Note = { id: Date.now().toString(), title: 'New Note', + content: '', lastEdited: new Date() }; setNotes([newNote, ...notes]); onNoteSelect?.(newNote); }; + const formatDate = (date: Date) => { + return format(date, 'EEEE d MMM yyyy, HH:mm', { locale: fr }); + }; + return ( -
- {/* Header */} -
-

Notes

+
+ {/* Search Header */} +
+
+ setSearchQuery(e.target.value)} + placeholder="Link tags, notes, files..." + className="w-full pl-9 pr-4 py-2 bg-white border border-carnet-border rounded-md text-sm text-carnet-text-primary placeholder-carnet-text-muted focus:outline-none focus:ring-1 focus:ring-primary" + /> + + {searchQuery && ( + + )} +
+
+ + {/* Category Header */} +
+
+
+ F +
+ Finance +
@@ -50,16 +91,32 @@ export const NotesView: React.FC = ({ onNoteSelect }) => { {notes.map((note) => (
onNoteSelect?.(note)} >
- - {note.title} - - - Last edited {note.lastEdited.toLocaleTimeString()} - +
+ + {note.title} + + {note.tags?.map((tag) => ( + + {tag} + + ))} +
+
+ {formatDate(note.lastEdited)} + {note.content && ( + <> + + {note.content} + + )} +
))} diff --git a/tailwind.config.ts b/tailwind.config.ts index fd8f8a2a..3032f301 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -62,6 +62,23 @@ const config: Config = { ring: 'hsl(var(--sidebar-ring))' }, panel: "#FCF8F2", + 'carnet': { + 'bg': '#ffffff', + 'sidebar': '#f7f7f7', + 'border': '#e5e5e5', + 'text': { + 'primary': '#1a1a1a', + 'secondary': '#666666', + 'muted': '#999999' + }, + 'tag': { + 'finance': { + 'bg': '#e8f5e9', + 'text': '#2e7d32' + } + }, + 'hover': '#f5f5f5' + } }, borderRadius: { lg: 'var(--radius)',