All checks were successful
Build and Push App / build (push) Successful in 5m59s
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import React from 'react';
|
|
import { getLegalDocument } from '@/lib/legal';
|
|
import { sanitizeHTML } from '@/lib/sanitize';
|
|
|
|
import { getSiteSettings } from '@/lib/settings';
|
|
import { Metadata } from 'next';
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const settings = await getSiteSettings();
|
|
return {
|
|
title: `Conditions Générales de Vente - ${settings.siteName}`,
|
|
description: `Consultez les conditions générales de vente des services ${settings.siteName}.`,
|
|
};
|
|
}
|
|
|
|
export default async function CGVPage() {
|
|
const doc = await getLegalDocument('CGV');
|
|
|
|
if (!doc) {
|
|
return (
|
|
<div className="bg-white min-h-screen py-16 px-4 flex items-center justify-center">
|
|
<p className="text-gray-500">Document non disponible.</p>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="bg-white min-h-screen py-16 px-4 sm:px-6 lg:px-8">
|
|
<div className="max-w-3xl mx-auto">
|
|
<h1 className="text-3xl font-serif font-bold text-gray-900 mb-8 border-b pb-4">
|
|
{doc.title}
|
|
</h1>
|
|
|
|
<div
|
|
className="prose prose-orange max-w-none text-gray-600 space-y-6"
|
|
dangerouslySetInnerHTML={{ __html: sanitizeHTML(doc.content) }}
|
|
/>
|
|
|
|
<div className="mt-12 pt-8 border-t border-gray-100 text-xs text-gray-400">
|
|
Dernière mise à jour : {new Date(doc.updatedAt).toLocaleDateString('fr-FR', { day: 'numeric', month: 'long', year: 'numeric' })}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|