From 8602bfa92f94185060a51df34045cac17065d623 Mon Sep 17 00:00:00 2001 From: Simone Cavalli Date: Thu, 14 May 2026 22:13:33 +0200 Subject: [PATCH] =?UTF-8?q?feat(01-04):=20DocumentsSection=20+=20NotesSect?= =?UTF-8?q?ion=20=E2=80=94=20link=20esterni=20e=20log=20decisioni=20read-o?= =?UTF-8?q?nly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DocumentsSection: link clickabili con target="_blank" rel="noopener noreferrer" icone SVG inline per documento ed external link, hover state con colore accent - NotesSection: note read-only con timestamp in locale it-IT (D-12: cliente legge, admin scrive) empty state informativo per entrambi i componenti - SVG inline al posto di lucide-react per compatibilita' massima --- src/components/documents-section.tsx | 71 ++++++++++++++++++++++++++++ src/components/notes-section.tsx | 49 +++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 src/components/documents-section.tsx create mode 100644 src/components/notes-section.tsx 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