+ {transcripts.map((t) => {
+ const isExpanded = expandedIds.has(t.id);
+ const formattedDate = format(
+ new Date(t.call_date + "T00:00:00"),
+ "d MMMM yyyy",
+ { locale: it }
+ );
+ const lines = t.content.split("\n");
+ const preview = lines.slice(0, 3).join("\n").slice(0, 200);
+ const hasMore = t.content.length > preview.length || lines.length > 3;
+
+ return (
+
+
+
+
+ {formattedDate}
+ {t.title && (
+ โ {t.title}
+ )}
+
+
+ {isExpanded ? t.content : preview}
+ {!isExpanded && hasMore && (
+ ...
+ )}
+
+ {hasMore && (
+
+ )}
+
+
+
+
+ );
+ })}
+
+ ) : (
+