mise a jour

This commit is contained in:
Emma781227
2026-07-08 07:10:49 +02:00
parent 68a9650223
commit 65d6b23233
12 changed files with 603 additions and 182 deletions

View File

@@ -1,12 +1,20 @@
import { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import UserNav from '../components/UserNav'
import { changePasswordApi } from '../services/auth'
import { changePasswordApi, deleteAccountApi } from '../services/auth'
import { useHandleAuthError } from '../hooks/useHandleAuthError'
import { useAuth } from '../context/AuthContext'
export default function Profile() {
const user = JSON.parse(localStorage.getItem('user') || '{}')
const initials = `${(user.firstname || '?')[0]}${(user.lastname || '?')[0]}`.toUpperCase()
const handleAuthError = useHandleAuthError()
const { logout } = useAuth()
const navigate = useNavigate()
const [showDeleteModal, setShowDeleteModal] = useState(false)
const [deleting, setDeleting] = useState(false)
const [deleteError, setDeleteError] = useState('')
const [pwForm, setPwForm] = useState({ currentPassword: '', newPassword: '', confirmPassword: '' })
const [showPw, setShowPw] = useState({ current: false, new: false, confirm: false })