Messages des visiteurs
-
Les mots laissés par celles et ceux qui passent par ici.
+
Les mots laissés par celles et ceux qui passent par ici.
-
{{ msg.text }}
-
-
{{ msg.author }}
-
·
-
{{ formatDate(msg.createdAt) }}
+
+
+ {{ msg.author }}
+ {{ typeLabel(msg.type) }}
+ {{ formatDate(msg.createdAt) }}
+
+
+
{{ msg.text }}
+
+
+
+
+
+
{{ msg.reply.text }}
+
-
Aucun message pour l'instant.
+
Aucun message pour l'instant.
@@ -34,6 +47,16 @@ useHead({
const { data: messages } = await useFetch('/api/messages')
+const TYPE_LABELS: Record = {
+ question: 'Question',
+ suggestion: 'Suggestion',
+ retour: 'Retour',
+}
+
+function typeLabel(type: string) {
+ return TYPE_LABELS[type] ?? type
+}
+
function formatDate(iso: string) {
const date = new Date(iso)
return date.toLocaleDateString('fr-FR', { day: 'numeric', month: 'long', year: 'numeric' })
@@ -41,10 +64,59 @@ function formatDate(iso: string) {