diff --git a/src/components/documents-section.tsx b/src/components/documents-section.tsx new file mode 100644 index 0000000..5d38243 --- /dev/null +++ b/src/components/documents-section.tsx @@ -0,0 +1,71 @@ +import type { ClientView } from '@/lib/client-view'; +import { Card } from '@/components/ui/card'; + +interface DocumentsSectionProps { + documents: ClientView['documents']; +} + +export function DocumentsSection({ documents }: DocumentsSectionProps) { + if (documents.length === 0) { + return ( +

+ Nessun documento ancora condiviso. +

+ ); + } + + return ( +
+ {documents.map((doc) => ( + + + {/* Icona documento */} +
+ + + {doc.label} + +
+ + {/* Icona external link */} + +
+
+ ))} +
+ ); +} \ No newline at end of file diff --git a/src/components/notes-section.tsx b/src/components/notes-section.tsx new file mode 100644 index 0000000..6088689 --- /dev/null +++ b/src/components/notes-section.tsx @@ -0,0 +1,49 @@ +import type { ClientView } from '@/lib/client-view'; +import { Card } from '@/components/ui/card'; + +interface NotesSectionProps { + notes: ClientView['notes']; +} + +export function NotesSection({ notes }: NotesSectionProps) { + if (notes.length === 0) { + return ( +

+ Nessuna nota ancora registrata. Le decisioni appariranno qui man mano che il progetto avanza. +

+ ); + } + + return ( +
+ {notes.map((note) => { + const dateFormatted = new Date(note.created_at).toLocaleDateString('it-IT', { + year: 'numeric', + month: 'long', + day: 'numeric', + }); + const timeFormatted = new Date(note.created_at).toLocaleTimeString('it-IT', { + hour: '2-digit', + minute: '2-digit', + }); + + return ( + + {/* Testo nota — sola lettura (D-12: admin scrive, cliente legge) */} +

+ {note.body} +

+ + {/* Timestamp */} +

+ {dateFormatted} alle {timeFormatted} +

+
+ ); + })} +
+ ); +} \ No newline at end of file