fix: suppress hydration warnings in JiraLogs, MarkdownEditor, and NotesList components

This commit is contained in:
Julien Froidefond
2025-10-16 05:17:41 +02:00
parent 7952459b42
commit a4188b09e5
4 changed files with 9 additions and 5 deletions

View File

@@ -126,7 +126,10 @@ export function JiraLogs({ className = '' }: JiraLogsProps) {
> >
<div className="flex items-center justify-between mb-2"> <div className="flex items-center justify-between mb-2">
{getStatusBadge(log.status)} {getStatusBadge(log.status)}
<span className="text-xs text-[var(--muted-foreground)]"> <span
className="text-xs text-[var(--muted-foreground)]"
suppressHydrationWarning
>
{formatDistanceToNow(parseDate(log.createdAt), { {formatDistanceToNow(parseDate(log.createdAt), {
addSuffix: true, addSuffix: true,
locale: fr, locale: fr,

View File

@@ -305,9 +305,9 @@ export function MarkdownEditor({
return () => document.removeEventListener('keydown', handleKeyDown); return () => document.removeEventListener('keydown', handleKeyDown);
}, [handleKeyDown]); }, [handleKeyDown]);
// Auto-save // Auto-save (uniquement en mode édition)
useEffect(() => { useEffect(() => {
if (autoSave && hasUnsavedChanges) { if (autoSave && hasUnsavedChanges && isEditing) {
if (autoSaveTimeoutRef.current) { if (autoSaveTimeoutRef.current) {
clearTimeout(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 // Détecter les changements
useEffect(() => { useEffect(() => {

View File

@@ -202,7 +202,7 @@ export function NotesList({
<div className="flex items-center gap-2 text-xs text-[var(--muted-foreground)]"> <div className="flex items-center gap-2 text-xs text-[var(--muted-foreground)]">
<Calendar className="w-3 h-3" /> <Calendar className="w-3 h-3" />
<span> <span suppressHydrationWarning>
{formatDistanceToNow(new Date(note.updatedAt), { {formatDistanceToNow(new Date(note.updatedAt), {
addSuffix: true, addSuffix: true,
locale: fr, locale: fr,

View File

@@ -3,6 +3,7 @@ import CredentialsProvider from 'next-auth/providers/credentials';
import { usersService } from '@/services/users'; import { usersService } from '@/services/users';
export const authOptions: NextAuthOptions = { export const authOptions: NextAuthOptions = {
secret: process.env.NEXTAUTH_SECRET,
providers: [ providers: [
CredentialsProvider({ CredentialsProvider({
name: 'credentials', name: 'credentials',