diff --git a/memento-note/components/note-editor/note-editor-toolbar.tsx b/memento-note/components/note-editor/note-editor-toolbar.tsx index 5e4b772..d5e0d6c 100644 --- a/memento-note/components/note-editor/note-editor-toolbar.tsx +++ b/memento-note/components/note-editor/note-editor-toolbar.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState, useRef, useCallback, useEffect } from 'react' +import { useState, useRef, useCallback } from 'react' import { useNoteEditorContext } from './note-editor-context' import { LabelManager } from '@/components/label-manager' import { LabelBadge } from '@/components/label-badge' @@ -46,22 +46,6 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme const [isConverting, setIsConverting] = useState(false) const [shareOpen, setShareOpen] = useState(false) const [flashcardsOpen, setFlashcardsOpen] = useState(false) - const [relativeTime, setRelativeTime] = useState(null) - - // Mise à jour du temps relatif depuis la dernière sauvegarde - useEffect(() => { - if (!state.lastSavedAt) { setRelativeTime(null); return } - const update = () => { - const secs = Math.floor((Date.now() - state.lastSavedAt!.getTime()) / 1000) - if (secs < 10) setRelativeTime(t('notes.savedJustNow') || 'Sauvegardé') - else if (secs < 60) setRelativeTime(`${secs}s`) - else setRelativeTime(`${Math.floor(secs / 60)}min`) - } - update() - const interval = setInterval(update, 10000) - return () => clearInterval(interval) - }, [state.lastSavedAt, t]) - const notebookName = notebooks.find(nb => nb.id === note.notebookId)?.name || null const undoSnapshotRef = useRef<{ content: string; isMarkdown: boolean } | null>(null) @@ -310,18 +294,6 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme {!readOnly && (
- {/* Indicateur dernière sauvegarde */} - {!state.isDirty && relativeTime && !state.isSaving && ( - - - {relativeTime} - - )} - {state.isDirty && !state.isSaving && ( - - {t('notes.unsaved') || '●'} - - )}