fix: suppress hydration warnings in JiraLogs, MarkdownEditor, and NotesList components
This commit is contained in:
@@ -126,7 +126,10 @@ export function JiraLogs({ className = '' }: JiraLogsProps) {
|
||||
>
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
{getStatusBadge(log.status)}
|
||||
<span className="text-xs text-[var(--muted-foreground)]">
|
||||
<span
|
||||
className="text-xs text-[var(--muted-foreground)]"
|
||||
suppressHydrationWarning
|
||||
>
|
||||
{formatDistanceToNow(parseDate(log.createdAt), {
|
||||
addSuffix: true,
|
||||
locale: fr,
|
||||
|
||||
@@ -305,9 +305,9 @@ export function MarkdownEditor({
|
||||
return () => document.removeEventListener('keydown', handleKeyDown);
|
||||
}, [handleKeyDown]);
|
||||
|
||||
// Auto-save
|
||||
// Auto-save (uniquement en mode édition)
|
||||
useEffect(() => {
|
||||
if (autoSave && hasUnsavedChanges) {
|
||||
if (autoSave && hasUnsavedChanges && isEditing) {
|
||||
if (autoSaveTimeoutRef.current) {
|
||||
clearTimeout(autoSaveTimeoutRef.current);
|
||||
}
|
||||
@@ -322,7 +322,7 @@ export function MarkdownEditor({
|
||||
}
|
||||
};
|
||||
}
|
||||
}, [value, autoSave, hasUnsavedChanges, handleSave]);
|
||||
}, [value, autoSave, hasUnsavedChanges, isEditing, handleSave]);
|
||||
|
||||
// Détecter les changements
|
||||
useEffect(() => {
|
||||
|
||||
@@ -202,7 +202,7 @@ export function NotesList({
|
||||
|
||||
<div className="flex items-center gap-2 text-xs text-[var(--muted-foreground)]">
|
||||
<Calendar className="w-3 h-3" />
|
||||
<span>
|
||||
<span suppressHydrationWarning>
|
||||
{formatDistanceToNow(new Date(note.updatedAt), {
|
||||
addSuffix: true,
|
||||
locale: fr,
|
||||
|
||||
@@ -3,6 +3,7 @@ import CredentialsProvider from 'next-auth/providers/credentials';
|
||||
import { usersService } from '@/services/users';
|
||||
|
||||
export const authOptions: NextAuthOptions = {
|
||||
secret: process.env.NEXTAUTH_SECRET,
|
||||
providers: [
|
||||
CredentialsProvider({
|
||||
name: 'credentials',
|
||||
|
||||
Reference in New Issue
Block a user