import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Sparkles, TrendingUp, Bug, Shield } from "lucide-react"; import { changelogData, ChangelogEntry } from "@/data/changelog"; import { SEO } from "@/components/SEO"; import { format, parseISO } from "date-fns"; import { fr } from "date-fns/locale"; const getCategoryConfig = (category: ChangelogEntry['category']) => { const configs = { feature: { icon: Sparkles, label: "Nouvelle fonctionnalité", variant: "default" as const, color: "text-primary" }, improvement: { icon: TrendingUp, label: "Amélioration", variant: "secondary" as const, color: "text-green-600 dark:text-green-400" }, bugfix: { icon: Bug, label: "Correction de bug", variant: "outline" as const, color: "text-orange-600 dark:text-orange-400" }, security: { icon: Shield, label: "Sécurité", variant: "destructive" as const, color: "text-destructive" } }; return configs[category]; }; const Changelog = () => { const sortedChangelog = [...changelogData].sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime() ); const latestUpdate = sortedChangelog[0]?.date; return ( <>
{/* Header */}

Changelog

Historique des évolutions du site

{sortedChangelog.length} versions Dernière mise à jour : {latestUpdate && format(parseISO(latestUpdate), "d MMMM yyyy", { locale: fr })}
{/* Timeline */}
{sortedChangelog.map((entry, index) => { const config = getCategoryConfig(entry.category); const Icon = config.icon; return (
{entry.title}
{config.label} v{entry.version} {format(parseISO(entry.date), "d MMMM yyyy", { locale: fr })}
{entry.description}
{entry.details && entry.details.length > 0 && (
    {entry.details.map((detail, idx) => (
  • {detail}
  • ))}
)}
{index < sortedChangelog.length - 1 && (
)}
); })}
); }; export default Changelog;