From 550bd71e33a10f6126155e1c9d8d8e449f3abddf Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Tue, 31 Mar 2026 23:26:09 +0530 Subject: [PATCH] fix --- src/app/dashboard/users/[id]/page.tsx | 102 +++++++++++--------------- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/src/app/dashboard/users/[id]/page.tsx b/src/app/dashboard/users/[id]/page.tsx index 9bff387..572ec01 100644 --- a/src/app/dashboard/users/[id]/page.tsx +++ b/src/app/dashboard/users/[id]/page.tsx @@ -473,32 +473,12 @@ export default function UserDetailPage() {
{/* Agent Details Grid */}
- {/* Agent Type - Editable */} + {/* Agent Type - Read Only */}
-

Agent Type

-
- - {selectedAgentTypeId && selectedAgentTypeId !== user.agentProfile?.agentTypeId && ( - - )} -
+

Agent Type

+

+ {user.agentProfile.agentType?.name || 'Not assigned'} +

Slug

@@ -566,6 +546,43 @@ export default function UserDetailPage() {
)} + {/* Dynamic Profile Data (only for AGENT role) */} + {user.role === 'AGENT' && agentFieldValues.length > 0 && ( +
+
+

Profile Details

+
+
+ {Object.entries( + agentFieldValues + .filter((fv) => fv.sectionSlug !== 'upload-documents') + .reduce((acc, fv) => { + if (!acc[fv.sectionName]) acc[fv.sectionName] = []; + acc[fv.sectionName].push(fv); + return acc; + }, {} as Record) + ).map(([sectionName, fields]) => ( +
+

{sectionName}

+
+ {fields.map((fv) => ( +
+

{fv.fieldName}

+

+ {fv.value === null || fv.value === undefined ? - : + Array.isArray(fv.value) ? fv.value.map((v: any) => typeof v === 'object' ? (v.label || v.name || JSON.stringify(v)) : String(v)).join(', ') : + typeof fv.value === 'object' ? JSON.stringify(fv.value) : + String(fv.value)} +

+
+ ))} +
+
+ ))} +
+
+ )} + {/* Verification Section (only for AGENT role) */} {user.role === 'AGENT' && user.agentProfile && (
@@ -592,41 +609,6 @@ export default function UserDetailPage() {
)} - {/* Agent Profile Data */} - {agentFieldValues.length > 0 && ( -
-

Profile Data

-
- {Object.entries( - agentFieldValues - .filter((fv) => fv.sectionSlug !== 'upload-documents') - .reduce((acc, fv) => { - if (!acc[fv.sectionName]) acc[fv.sectionName] = []; - acc[fv.sectionName].push(fv); - return acc; - }, {} as Record) - ).map(([sectionName, fields]) => ( -
-

{sectionName}

-
- {fields.map((fv) => ( -
- {fv.fieldName}: - - {fv.value === null || fv.value === undefined ? '-' : - Array.isArray(fv.value) ? fv.value.map((v: any) => typeof v === 'object' ? (v.label || v.name || JSON.stringify(v)) : String(v)).join(', ') : - typeof fv.value === 'object' ? JSON.stringify(fv.value) : - String(fv.value)} - -
- ))} -
-
- ))} -
-
- )} - {/* Uploaded Documents */}

Uploaded Documents