fix: redesign note history disabled state with centered icon + better copy
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 42s

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-28 22:28:30 +02:00
parent 6f2b0279ff
commit b9175ce32d
3 changed files with 15 additions and 7 deletions

View File

@@ -4,7 +4,7 @@ import { useEffect, useMemo, useState, useTransition } from 'react'
import { formatDistanceToNow } from 'date-fns'
import { fr } from 'date-fns/locale/fr'
import { enUS } from 'date-fns/locale/en-US'
import { History, Loader2, RotateCcw, Trash2 } from 'lucide-react'
import { History, Loader2, RotateCcw, Trash2, GitBranchPlus } from 'lucide-react'
import { toast } from 'sonner'
import { getNoteHistory, restoreNoteVersion, deleteNoteHistoryEntry } from '@/app/actions/notes'
import { Button } from '@/components/ui/button'
@@ -136,11 +136,17 @@ export function NoteHistoryModal({
</DialogHeader>
{!enabled ? (
<div className="space-y-3 px-6 py-8">
<p className="text-sm text-muted-foreground">
{t('notes.historyDisabledDesc') || "L'historique est désactivé pour votre compte."}
<div className="flex flex-col items-center justify-center px-6 py-16 text-center">
<div className="flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10 mb-5">
<GitBranchPlus className="h-8 w-8 text-primary" />
</div>
<h3 className="text-base font-semibold text-foreground mb-1.5">
{t('notes.historyDisabledTitle') || 'Historique des versions'}
</h3>
<p className="text-sm text-muted-foreground max-w-xs mb-6 leading-relaxed">
{t('notes.historyDisabledDesc') || "Suivez les modifications de cette note au fil du temps. Activez l'historique pour commencer à enregistrer des versions."}
</p>
<Button onClick={handleEnable} disabled={isEnabling}>
<Button onClick={handleEnable} disabled={isEnabling} size="lg" className="rounded-full px-8">
{isEnabling && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
{t('notes.enableHistory') || "Activer l'historique"}
</Button>