diff --git a/components/settings/unified/tabs/AccountProfileTab.tsx b/components/settings/unified/tabs/AccountProfileTab.tsx index 306d1c0..89d09a3 100644 --- a/components/settings/unified/tabs/AccountProfileTab.tsx +++ b/components/settings/unified/tabs/AccountProfileTab.tsx @@ -1,11 +1,12 @@ 'use client' import { useState, useEffect, useRef, useCallback } from 'react' -import { Input, Button, toast, Spinner } from '@ciphera-net/ui' +import { Input, toast, Spinner } from '@ciphera-net/ui' import { useAuth } from '@/lib/auth/context' import { updateDisplayName } from '@/lib/api/user' import { deleteAccount } from '@/lib/api/user' import { getAuthErrorMessage } from '@ciphera-net/ui' +import { DangerZone } from '@/components/settings/unified/DangerZone' export default function AccountProfileTab({ onDirtyChange, onRegisterSave }: { onDirtyChange?: (dirty: boolean) => void; onRegisterSave?: (fn: () => Promise) => void }) { const { user, refresh, logout } = useAuth() @@ -61,7 +62,7 @@ export default function AccountProfileTab({ onDirtyChange, onRegisterSave }: { o if (!user) return
return ( -
+

Profile

Manage your personal account settings.

@@ -87,66 +88,58 @@ export default function AccountProfileTab({ onDirtyChange, onRegisterSave }: { o
{/* Danger Zone */} -
-

Danger Zone

-
-
-
-

Delete Account

-

Permanently delete your account and all associated data.

-
- + setShowDeleteConfirm(prev => !prev), + }, + ]} + /> + + {showDeleteConfirm && ( +
+

This will permanently delete:

+
    +
  • Your account and all personal data
  • +
  • All sessions and trusted devices
  • +
  • You will be removed from all organizations
  • +
+
+ + setDeletePassword(e.target.value)} + placeholder="Enter your password" + /> +
+
+ + setDeleteText(e.target.value)} + placeholder="DELETE" + /> +
+
+ +
- {showDeleteConfirm && ( -
-

This will permanently delete:

-
    -
  • Your account and all personal data
  • -
  • All sessions and trusted devices
  • -
  • You will be removed from all organizations
  • -
-
- - setDeletePassword(e.target.value)} - className="w-full px-3 py-2 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm" - placeholder="Enter your password" - /> -
-
- - setDeleteText(e.target.value)} - className="w-full px-3 py-2 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm" - placeholder="DELETE" - /> -
-
- - -
-
- )}
-
+ )}
) }