feat: Implement dynamic city and state retrieval and display for profiles, utilizing new data mapping and updated UI logic.

This commit is contained in:
pradeepkumar
2026-02-01 23:25:27 +05:30
parent bb7706d152
commit b88e47f911
3 changed files with 100 additions and 13 deletions

View File

@@ -81,6 +81,8 @@ const defaultProfileCardData: ProfileCardData = {
bio: '',
expertise: [],
serviceAreas: [],
city: null,
state: null,
};
// Default availability data when no field values are available
@@ -316,7 +318,11 @@ export default function AgentDashboard() {
lastName={agentProfile.lastName}
isVerified={agentProfile.isVerified}
title={agentProfile.agentType?.name || 'Real Estate Agent'}
location={profileCardData.serviceAreas?.[0] || (agentProfile as unknown as { city?: string }).city || 'United States'}
location={
profileCardData.city && profileCardData.state
? `${profileCardData.city}, ${profileCardData.state}`
: profileCardData.city || profileCardData.state || profileCardData.serviceAreas?.[0] || 'United States'
}
memberSince={formatMemberSince((agentProfile as unknown as { createdAt?: string }).createdAt)}
bio={profileCardData.bio || agentProfile.bio || ''}
expertise={profileCardData.expertise}