feat: remove user verification button and related logic from AdminUserVerifyPage
This commit is contained in:
parent
3f247e2397
commit
8307654458
@ -5,7 +5,6 @@ import PageLayout from '../../components/PageLayout'
|
|||||||
import UserDetailModal from '../../components/UserDetailModal'
|
import UserDetailModal from '../../components/UserDetailModal'
|
||||||
import {
|
import {
|
||||||
MagnifyingGlassIcon,
|
MagnifyingGlassIcon,
|
||||||
CheckIcon,
|
|
||||||
ExclamationTriangleIcon,
|
ExclamationTriangleIcon,
|
||||||
EyeIcon
|
EyeIcon
|
||||||
} from '@heroicons/react/24/outline'
|
} from '@heroicons/react/24/outline'
|
||||||
@ -20,8 +19,6 @@ export default function AdminUserVerifyPage() {
|
|||||||
pendingUsers,
|
pendingUsers,
|
||||||
loading,
|
loading,
|
||||||
error,
|
error,
|
||||||
verifying,
|
|
||||||
verifyUser: handleVerifyUser,
|
|
||||||
isAdmin,
|
isAdmin,
|
||||||
fetchPendingUsers
|
fetchPendingUsers
|
||||||
} = useAdminUsers()
|
} = useAdminUsers()
|
||||||
@ -275,13 +272,8 @@ export default function AdminUserVerifyPage() {
|
|||||||
? (u.company_name?.[0] || 'C').toUpperCase()
|
? (u.company_name?.[0] || 'C').toUpperCase()
|
||||||
: `${u.first_name?.[0] || 'U'}${u.last_name?.[0] || 'U'}`.toUpperCase()
|
: `${u.first_name?.[0] || 'U'}${u.last_name?.[0] || 'U'}`.toUpperCase()
|
||||||
|
|
||||||
const isVerifying = verifying.has(u.id.toString())
|
|
||||||
const createdDate = new Date(u.created_at).toLocaleDateString()
|
const createdDate = new Date(u.created_at).toLocaleDateString()
|
||||||
|
|
||||||
// Check if user has completed all verification steps
|
|
||||||
const isReadyToVerify = u.email_verified === 1 && u.profile_completed === 1 &&
|
|
||||||
u.documents_uploaded === 1 && u.contract_signed === 1
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={u.id} className="hover:bg-blue-50">
|
<tr key={u.id} className="hover:bg-blue-50">
|
||||||
<td className="px-4 py-4">
|
<td className="px-4 py-4">
|
||||||
@ -314,30 +306,6 @@ export default function AdminUserVerifyPage() {
|
|||||||
<EyeIcon className="h-4 w-4" /> View
|
<EyeIcon className="h-4 w-4" /> View
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{isReadyToVerify ? (
|
|
||||||
<button
|
|
||||||
onClick={() => handleVerifyUser(u.id.toString())}
|
|
||||||
disabled={isVerifying}
|
|
||||||
className={`inline-flex items-center gap-1 rounded-lg border px-3 py-2 text-xs font-medium transition
|
|
||||||
${isVerifying
|
|
||||||
? 'border-gray-200 bg-gray-100 text-gray-400 cursor-not-allowed'
|
|
||||||
: 'border-emerald-200 bg-emerald-50 hover:bg-emerald-100 text-emerald-700'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{isVerifying ? (
|
|
||||||
<>
|
|
||||||
<span className="h-3 w-3 rounded-full border-2 border-emerald-500 border-b-transparent animate-spin" />
|
|
||||||
Verifying...
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<CheckIcon className="h-4 w-4" /> Verify
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
) : (
|
|
||||||
<span className="text-xs text-gray-500 italic">Incomplete steps</span>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user