'use client'; import React, { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { getTwoFactorAuthStatus } from '@/app/API/profile/twoFactorAuth'; import './security.scss'; const SecurityPage = () => { const router = useRouter(); const [loading, setLoading] = useState(true); const [twoFactorEnabled, setTwoFactorEnabled] = useState(false); const [error, setError] = useState(null); useEffect(() => { const fetchSecuritySettings = async () => { try { const response = await getTwoFactorAuthStatus(); if (response.status === 'success' && response.data) { setTwoFactorEnabled(response.data.enabled); } } catch (err) { setError('Failed to load security settings'); } finally { setLoading(false); } }; fetchSecuritySettings(); }, []); if (loading) { return (

Security Settings

Loading...
); } return (

Security Settings

Manage your account security and privacy

{error && (
{error}
)}

Two-Factor Authentication

{twoFactorEnabled ? "Your account is protected with an additional security layer" : "Add an extra layer of security to your account"}

{twoFactorEnabled ? 'Enabled' : 'Disabled'}
{twoFactorEnabled ? 'Manage' : 'Setup'}

Password Management

Update your password regularly to keep your account secure

Change Password

Email Management

Update your email address or verify your current email

Update Email

Account Deletion

Permanently delete your account and all associated data

Irreversible Action
Delete Account
); }; export default SecurityPage;